<template>
  <div class="crackDown">
    <timePicker @timeChange="timeChangeFn" />
    <div class="crackDownLeft">
      <div
        class="mode-title"
        :style="`background:url(${bgImg[0]});background-size: 100% 100%;`"
      ></div>
      <framemain class="lftopdiv">
        <div class="rollTable">
          <!-- <dv-scroll-board
            :config="config"
            style="width: 100%; height: 264px"
          /> -->
          <div
            class="width100per dflex justifybetween fontsize14 whitecolor fontweight bgtitlexsqka"
          >
            <div class="width100px txtcenter">案发时间</div>
            <div class="width150px txtcenter">查获单位</div>
            <div class="width150px txtcenter">数量(条)</div>
            <div class="width150px txtcenter">案值(元)</div>
          </div>
          <vue-seamless-scroll
            class="yjssxxdiv"
            :data="RealTimeCases"
            :class-option="scrollOption"
          >
            <ul class="yjssxxdiv" style="height: auto">
              <li v-for="(item, index) in RealTimeCases" :key="index">
                <div
                  class="width100per dflex justifycont alignitem fontsize14 whitecolor"
                >
                  <!-- <div class="marginright15px">
                    <div class="circledot" :class="divcolorswitch(item)"></div>
                  </div> -->
                  <div class="marginright15px marginleft15px">
                    {{ item.ascase_date }}
                  </div>
                  <div class="marginright10px textoverflow width160px">
                    {{ item.org_short_name }}
                  </div>
                  <div class="partflex textElep">{{ item.caseQty }}</div>
                  <div class="partflex textElep marginright15px">
                    {{ item.caseVal }}
                  </div>
                </div>
              </li>
            </ul>
          </vue-seamless-scroll>
        </div>
      </framemain>
      <div class="rightbox2" style="margin-top: 20px">
        <div
          class="mode-title"
          :style="`background:url(${!showType ? bgImg[2] : bgImg[1]});`"
          @click="overview(0)"
        ></div>
        <div
          class="mode-title"
          :style="`background:url(${showType === 1 ? bgImg[4] : bgImg[3]});`"
          @click="overview(1)"
        ></div>
        <div
          class="mode-title"
          :style="`background:url(${showType === 2 ? bgImg[6] : bgImg[5]});`"
          @click="overview(2)"
        ></div>
      </div>
      <framemain v-if="!showType" class="lfbotdiv">
        <div
          class="anzl-num-box"
          :style="`background:url(${bgImg[7]});background-size: 100% 100% !important;`"
        >
          <div class="list-two-item">
            <div class="title fs-18 fw-600">
              查获案件总数(起)
              <span class="fs-20 fw-600 main-color">
                <my-tooltip
                  tooltipBoxStyle="left: -60px;top:35px;width: 200px"
                  :numData="numData6"
                  :popData="popData6"
                />
              </span>
            </div>
          </div>

          <!-- <div class="justifycont alignitem aligncon marginright10px">
            <div class="fontsize14 displayline">同比&nbsp;</div>
            <div class="fontsize14 lightblue displayline">
              <CountTo
                :startVal="0"
                :endVal="Number(caseTotalObj.total.per)"
                :duration="3000"
                :decimals="2"
              />%
              <img src="../../assets/common-new/green-top.png" alt="" />
            </div>
          </div> -->
        </div>
        <div class="wpzl-box">
          <div class="wpzl-content">
            <div
              class="content-item"
              v-for="(item, index) in caseTotalObj.list"
              :key="index"
            >
              <div class="title fs-16">{{ item.title }}</div>
              <div class="fs-24 fw-600 num">
                <div class="main-color">
                  <my-tooltip
                    v-if="index == 0"
                    tooltipBoxStyle="left: -60px;top:25px;width: 200px"
                    :numData="caseTotalnumData1"
                    :popData="caseTotalpopData1"
                  />
                  <my-tooltip
                    v-if="index == 1"
                    tooltipBoxStyle="left: -55px;top:25px;width: 200px"
                    :numData="caseTotalnumData2"
                    :popData="caseTotalpopData2"
                  />
                  <my-tooltip
                    v-if="index == 2"
                    tooltipBoxStyle="left: -60px;top:25px;width: 200px"
                    :numData="caseTotalnumData3"
                    :popData="caseTotalpopData3"
                  />
                  <my-tooltip
                    v-if="index == 3"
                    tooltipBoxStyle="left: -60px;top:25px;width: 200px"
                    :numData="caseTotalnumData4"
                    :popData="caseTotalpopData4"
                  />
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- <div class="botdivTop">
          <labelLineAdjust :labelLineObj="labelLineObj1"></labelLineAdjust>
          <labelLineAdjust :labelLineObj="labelLineObj2"></labelLineAdjust>
        </div> -->
        <!--   <div class="botdivCenter">
          <div class="ajzl-center">
            <el-popover
              v-for="(item, index) in caseTotalObj.list"
              class="ajzl-center-item"
              :key="index"
              placement="top-start"
              title=""
              width="650"
              trigger="hover"
              :style="`background:url(${bgImg[8]});`"
            >
              <div slot="reference">
                <p style="margin-right: 10px" class="fs-14">
                  {{ item.title }}
                </p>
                <p class="main-color fs-20">
                  <CountTo
                    :startVal="0"
                    :endVal="Number(item.num)"
                    :duration="3000"
                  />
                </p>
                <span>&nbsp;起</span>
              </div>
            </el-popover>
          </div>
        </div> -->

        <div class="btobtoBox" style="margin: 10px">
          <div
            id="echartsPie"
            :key="1"
            style="width: 100%; height: 120px"
          ></div>
        </div>
        <div class="btobtoBox" style="margin: 10px">
          <div
            id="echartsPieFrom"
            :key="1"
            style="width: 100%; height: 120px"
          ></div>
        </div>
      </framemain>
      <!-- 案值总览 -->
      <framemain v-if="showType === 1" class="lfbotdiv">
        <div
          class="anzl-num-box"
          :style="`background:url(${bgImg[7]});background-size: 100% 100% !important;`"
        >
          <div class="list-two-item">
            <div class="title fs-18 fw-600">
              涉案案值(万元)
              <span class="fs-20 fw-600 main-color">
                <!--  <count-to
                  :startVal="0"
                  :endVal="Number(caseValNums.cigarValYearOnYear.data[0].num)"
                  :duration="3000"
                  :decimals="2"
                ></count-to> -->
                <my-tooltip
                  tooltipBoxStyle="left: -60px;top:35px;width: 200px"
                  :numData="numData5"
                  :popData="popData5"
                />
              </span>
            </div>
          </div>

          <!--    <div class="justifycont alignitem aligncon marginright10px">
            <div class="fontsize14 displayline">同比</div>
            <div
              class="fontsize14 lightblue displayline"
              v-if="caseValNums.cigarValYearOnYear.data[0].yearOnYear !== '-'"
            >
              <count-to
                :startVal="0"
                :endVal="
                  Number(caseValNums.cigarValYearOnYear.data[0].yearOnYear)
                "
                :decimals="2"
                :duration="3000"
              ></count-to
              >%
              <img
                src="../../assets/common-new/green-top.png"
                v-if="caseValNums.cigarValYearOnYear.data[0].yearOnYear !== '-'"
                alt=""
              />
              <span
                v-if="caseValNums.cigarValYearOnYear.data[0].yearOnYear == '-'"
                class="main-color"
                >-</span
              >
            </div>
          </div> -->
        </div>
        <!--  <div class="botdivCenter">
          <div class="list-one">
            <div
              class="list-one-item"
              v-for="(item, index) in pingpai"
              :key="index"
            >
              <div class="num">
                <div class="text">
                  <span class="fs-24 main-color fw-600"
                    ><count-to
                      :startVal="0"
                      :endVal="Number(item.num)"
                      :duration="3000"
                      :decimals="2"
                    ></count-to
                  ></span>
                </div>
                <div class="title2">
                  <span class="fs-14 fw-600">{{ item.name }}</span>
                </div>
                <div class="per fs-14">
                  <span>同比</span>&nbsp;&nbsp;
                  <span class="main-color" v-if="item.per !== '-'"
                    ><count-to
                      :startVal="0"
                      :endVal="Number(item.per)"
                      :duration="3000"
                      :decimals="2"
                    ></count-to
                    >%</span
                  >
                  <span v-if="item.per !== '-'">
                    <img
                      v-if="item.per < 0"
                      src="../../assets/common-new/red-down.png"
                      alt="" />
                    <img
                      v-else
                      src="../../assets/common-new/green-top.png"
                      alt=""
                  /></span>
                  <span class="main-color" v-if="item.per == '-'">-</span>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="botdivTop mt-10">
          <labelLineAdjust :labelLineObj="labelLineObj3"></labelLineAdjust>
          <labelLineAdjust :labelLineObj="labelLineObj4"></labelLineAdjust>
        </div> -->
        <div class="wpzl-box">
          <div class="wpzl-content">
            <div
              class="content-item"
              v-for="(item, index) in pingpai"
              :key="index"
            >
              <div class="title fs-16">{{ item.name }}</div>
              <div class="fs-24 fw-600 num">
                <div class="main-color">
                  <my-tooltip
                    v-if="index == 0"
                    tooltipBoxStyle="left: -40px;top:25px;width: 200px"
                    :numData="pingpainumData1"
                    :popData="pingpaipopData1"
                  />
                  <my-tooltip
                    v-if="index == 1"
                    tooltipBoxStyle="left: -55px;top:25px;width: 200px"
                    :numData="pingpainumData2"
                    :popData="pingpaipopData2"
                  />
                  <my-tooltip
                    v-if="index == 2"
                    tooltipBoxStyle="left: -45px;top:25px;width: 200px"
                    :numData="pingpainumData3"
                    :popData="pingpaipopData3"
                  />
                  <my-tooltip
                    v-if="index == 3"
                    tooltipBoxStyle="left: -45px;top:25px;width: 200px"
                    :numData="pingpainumData4"
                    :popData="pingpaipopData4"
                  />
                </div>
              </div>
            </div>
          </div>
          <div class="btobtoBox" style="margin: 10px">
            <labelLineAdjust :labelLineObj="labelLineObj3"></labelLineAdjust>
          </div>
          <div class="btobtoBox" style="margin: 10px">
            <labelLineAdjust :labelLineObj="labelLineObj4"></labelLineAdjust>
          </div>
        </div>
        <!--  <div class="botdivbot mt-25">
          <div class="btn">
            <div
              :class="
                activeAzzlIndex === index ? 'btn-item-active' : 'btn-item'
              "
              v-for="(item, index) in ajzlBtn"
              :key="index"
              @click="toggleBtn2(index)"
            >
              {{ item }}
            </div>
          </div>
          <foldLine
            v-if="DataDM.length"
            :caseType="activeAzzlIndex"
            :DataDM="DataDM"
            :DataA="DataA"
          ></foldLine>
        </div> -->
      </framemain>
      <!-- 物品总览 -->
      <framemain v-if="showType === 2" class="lfbotdiv">
        <div
          class="anzl-num-box"
          :style="`background:url(${bgImg[7]});background-size: 100% 100% !important;`"
        ></div>
        <div class="wpzl-box">
          <div class="wpzl-content">
            <div
              class="content-item"
              v-for="(item, index) in articleList.list"
              :key="index"
            >
              <div class="title fs-16">{{ item.text }}</div>
              <div class="fs-24 fw-600 num">
                <div class="main-color">
                  <!-- <CountTo
                  :startVal="0"
                  :endVal="Number(item.num)"
                  :duration="3000"
                /> -->
                  <my-tooltip
                    v-if="index == 0"
                    tooltipBoxStyle="left: -40px;top:25px;width: 200px"
                    :numData="numData1"
                    :popData="popData1"
                  />
                  <my-tooltip
                    v-if="index == 1"
                    tooltipBoxStyle="left: -40px;top:25px;width: 200px"
                    :numData="numData2"
                    :popData="popData2"
                  />
                  <my-tooltip
                    v-if="index == 2"
                    tooltipBoxStyle="left: -55px;top:25px;width: 200px"
                    :numData="numData3"
                    :popData="popData3"
                  />
                  <my-tooltip
                    v-if="index == 3"
                    tooltipBoxStyle="left: -80px;top:25px;width: 200px"
                    :numData="numData4"
                    :popData="popData4"
                  />
                </div>
              </div>
            </div>
          </div>
          <div class="btobtoBox" style="margin: 10px">
            <labelLineAdjust :labelLineObj="labelLineObj5"></labelLineAdjust>
          </div>
          <div class="btobtoBox" style="margin: 10px">
            <labelLineAdjust :labelLineObj="labelLineObj6"></labelLineAdjust>
          </div>
        </div>
      </framemain>
    </div>
    <div class="qjzlcenter">
      <div class="center-map">
        <div class="map-title">
          <div class="maptableft" style="width: 100%">
            <!-- <div
            class="map-title" v-on:click="mapBack()"
            :style="`background:url(${bgImg[14]});width:100%;height:40px;background-size: 100% 100% !important;`"
          ></div> -->
            <div
              class="map-title"
              :style="`width:100%;height:40px;background-size: 100% 100% !important;`"
            >
              <span
                style="margin-left: 10px"
                v-for="(item, index) in clickArea"
                :key="item"
              >
                <!-- <img src="../../assets/common-new/back.png" alt="" /> -->
                <div class="prov" @click="mapBack(index)">
                  {{ item }}
                  <span v-if="index != clickArea.length - 1"> / </span>
                </div>
              </span>
            </div>
          </div>
          <div class="maptabright" style="flex: 1">
            <div class="dflex" style="width: 100%; position: relative">
              <div
                class="fontsize14 dflex"
                style="
                  position: absolute;
                  right: 0;
                  top: 0;
                  align-items: center;
                  justify-content: flex-end;
                "
              >
                <!-- <div class="timebg">
                {{ nowTime }}
              </div> -->
              </div>
            </div>
          </div>
          <!-- <div class="maptabright">
          <div class="dflex">
            <div class=""></div>
          </div>
        </div> -->
        </div>
        <custom-list
          v-if="LeftListItems.length!=0&&titleMap.level==1"
          position="left"
          :title="LeftListTitle"
          :columns="LeftListColumns"
          :items="LeftListItems"
        />
        <!-- <div class="width100per divclear anhuiMap" > -->
        <!-- <div v-if="isHideShow" style="height: 485px"></div> -->
        <anhuiMap
          :idName="'crackDownMap'"
          ref="crackDownMap"
          :heightSet="'485px'"
          :zoom="1.2"
          :mapTop="'15px'"
          :layoutCenter="['50%', '50%']"
          :formatterCustom="formatterCustom"
          :data="mapData"
        ></anhuiMap>
        <!-- </div> -->
        <custom-list
          v-if="RightListItems.length!=0&&titleMap.level==1"
          position="right"
          :title="RightListTitle"
          :columns="RightListColumns"
          :items="RightListItems"
        />
      </div>
      <!-- 重大案件部分 -->
      <div
        class="mode-title"
        :style="`background:url(${bgImg[9]});background-size: 100% 100%`"
      ></div>
      <div class="width100per centerBto">
        <div class="overviewHeader">
          <div class="overviewHeaderL">
            <span>部级督办案件(起)</span>
            <span>
              <span class="fs-24 main-color fw-600">
                <count-to
                  :startVal="0"
                  :endVal="Number(bigCase.listOne.bdNum)"
                  :duration="3000"
                ></count-to
              ></span>
              <!-- <span class="fs-14"> (起)</span> -->
            </span>
          </div>
          <div class="overviewHeaderR">
            <span>国家局表彰案件(起)</span>
            <span>
              <span class="fs-24 main-color fw-600">
                <count-to
                  :startVal="0"
                  :endVal="Number(bigCase.listOne.bzNum)"
                  :duration="3000"
                ></count-to
              ></span>
              <!-- <span class="fs-14"> (起)</span> -->
            </span>
          </div>
        </div>
        <div class="overviewContent">
          <div class="width100per dflex justifybetween alignitem marginbot24">
            <div class=" " v-for="(item, index) in tjaj.list" :key="index">
              <div class="width100per dflex justifycont alignitem">
                <div class="justifycont alignitem aligncon marginright12px">
                  <span class="fw-600 mr-10">
                    {{ item.name }}
                  </span>
                  <span class="fs-24 main-color fw-600 mr-5">
                    <!-- {{ item.num }} -->
                    <count-to
                      :startVal="0"
                      :endVal="Number(item.num)"
                      :duration="3000"
                    ></count-to>
                  </span>
                  <!-- <span class="fs-14">(起)</span> -->
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="overviewbto">
          <div class="dashboard">
            <div v-for="item in globalSuperData.list" :key="item.id">
              <!-- <div style="transform: rotateY(180deg); positon: absolute">
                <div id="zdaj-gauge" style="height: 80px"></div>
              </div> -->
              <div style="margin: 0 auto">
                <global-supervision-second
                  :ref="item.id"
                  :seriesCenter="['50%', '75%']"
                  :heightNum="'80px'"
                  :gsData="item"
                ></global-supervision-second>
              </div>
              {{ item.name }}:<count-to
                :startVal="0"
                :endVal="Number(item.num)"
                :duration="3000"
              ></count-to
              >起
              <span v-if="item.radio && item.radio !== '-' && item.radio > 0"
                ><img src="../../assets/common-new/green-top.png" alt=""
              /></span>
              <span v-if="item.radio && item.radio !== '-' && item.radio < 0"
                ><img src="../../assets/common-new/red-down.png" alt=""
              /></span>
            </div>
          </div>
          <div class="ks-list">
            <div
              class="ks-list-item"
              v-for="item in totalList"
              :key="item.name"
            >
              {{ item.name }}
              <span class="main-color">
                <count-to
                  :startVal="0"
                  :endVal="Number(item.num)"
                  :duration="3000"
                ></count-to>
              </span>
              <span>人</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="qjzlright">
      <!-- <div class="dflex width100per justifybetween">
        <div class="lftitlebga">行业案件数据</div>
      </div>
      <div class="leftImage">
        <img src="../../assets/case-new/1.png" alt="" />
      </div> -->
      <div
        class="mode-title"
        :style="`background:url(${bgImg[10]});background-size: 100% 100%;`"
      ></div>
      <div class="leftImage ajdb-box">
        <div class="btn">
          <div
            :class="activeAjdbIndex === index ? 'btn-item-active' : 'btn-item'"
            v-for="(item, index) in ajdbBtn"
            :key="index"
            @click="toggleBtn(index)"
            style="width:33%;margin-left:-15px"
          >
            {{ item }}
          </div>
        </div>
        <div class="content">
          <div v-if="activeAjdbIndex === 0">
            <div
              id="jsy-box"
              key="jsy"
              style="width: 450px; height: 240px"
            ></div>
          </div>
          <!-- 投诉举报echarts -->
          <div v-else-if="activeAjdbIndex === 1">
            <div id="yj-box" key="yj" style="width: 450px; height: 240px"></div>
          </div>
          <!-- 5+5 -->
          <div v-else-if="activeAjdbIndex === 2">
            <div
              id="yyys-box"
              key="yyys"
              style="width: 450px; height: 240px"
            ></div>
          </div>
        </div>
      </div>
      <!-- 真烟异流 -->
      <div class="zjzl-box">
        <div
          class="mode-title"
          :style="`background:url(${bgImg[11]});background-size: 100% 100%;`"
        ></div>
        <div class="main">
          <div class="list-one-title">
            <img src="../../assets/djds-new/zyyl/zylc-title.png" alt="" />
          </div>
          <div class="list-one" style="margin-bottom: 14px">
            <div
              class="list-one-item"
              v-for="(item, index) in NewZYYL.listOne"
              :key="index"
            >
              <div class="title fs-16 fw-600">{{ item.title }}</div>
              <div class="num">
                <div class="text" :class="(item.num==0 || item.num==='-') ? 'main-color':(item.num > 0) ?'safe-color':'danger-color'">
                  <span v-if="item.num&& item.num.length!=0  && item.num!=='-'" class="fs-24  fw-600">
                    <count-to
                        :startVal="0"
                        :endVal="Number(item.num)"
                        :duration="3000"
                        :decimals="2"
                    ></count-to
                    >
                  <span
                      class="fs-14"
                      :class="item.unit === '%' ? '' : ''"
                  >{{ item.unit }}</span
                  >
                  <span v-if="item.unit === '%'">
                    <span v-if="item.num > 0"
                    ><img src="../../assets/common-new/green-top.png" alt=""
                    /></span>
                    <span v-else
                    ><img
                        src="../../assets/common-new/red-down.png"
                        alt="" /></span
                    ></span>
                  </span>
                  <span v-else-if="Number.isInteger(item.num)" class="fs-24  fw-600">{{item.num}}</span>
                  <span v-else class="fs-24  fw-600">-</span>
                </div>
                <div class="title2">
                  <span class="fs-14 fw-600">{{ item.title2 }}</span>
                </div>
              </div>
            </div>
          </div>
          <div class="list-one-title">
            <img src="../../assets/djds-new/zyyl/zych-title.png" alt="" />
          </div>
          <div class="list-two">
            <div
              class="list-one-item"
              v-for="(item, index) in NewZYYL.listTwo"
              :key="index"
            >
              <div class="title fs-16 fw-600">{{ item.title }}</div>
              <div class="num">
                <div class="text" :class="(item.num==0 || item.num==='-') ? 'main-color':(item.num > 0) ?'safe-color':'danger-color'">
                  <span v-if="item.num&& item.num.length!=0  && item.num!=='-'" class="fs-24  fw-600">
                    <count-to
                      :startVal="0"
                      :endVal="Number(item.num)"
                      :duration="3000"
                      :decimals="2"
                    ></count-to
                  >
                  <span
                      class="fs-14"
                      :class="item.unit === '%' ? '' : ''"
                  >{{ item.unit }}</span
                  >
                  <span v-if="item.unit === '%'">
                    <span v-if="item.num > 0"
                    ><img src="../../assets/common-new/green-top.png" alt=""
                    /></span>
                    <span v-else
                    ><img
                        src="../../assets/common-new/red-down.png"
                        alt="" /></span
                    ></span>
                  </span>
                  <span v-else-if="Number.isInteger(item.num)" class="fs-24  fw-600">{{item.num}}</span>
                  <span v-else class="fs-24  fw-600">-</span>
                </div>
                <div class="title2">
                  <span class="fs-14 fw-600">{{ item.title2 }}</span>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!-- 真烟异流结束 -->
      <div class="zyyl-box">
        <div
          class="mode-title"
          :style="`background:url(${bgImg[12]});background-size: 100% 100%;`"
        ></div>
        <div class="content">
          <div
            class="content-item"
            v-for="(item, index) in [
              NewAJJG.list[0],
              NewAJJG.list[1],
              NewAJJG.list[2],
              NewAJJG.list[3],
            ]"
            :key="index"
            style="height: 55px; padding: 15px 0"
          >
            <div class="title fs-16 fw-600">{{ item.title }}</div>
            <div class="num">
              <div class="text">
                <span class="fs-24 main-color fw-600">
                  <count-to
                    v-if="item.num != '-'"
                    :startVal="0"
                    :endVal="Number(item.num) || 0"
                    :duration="3000"
                    :decimals="item.decimals"
                  ></count-to>
                  <span v-else>
                    {{ "-" }}
                  </span>
                </span>
                <!-- <span class="fs-14">{{ item.unit }}</span> -->
              </div>
            </div>
          </div>
          <div
            class="content-item1"
            v-for="(item, index) in [NewAJJG.list[4]]"
            :key=""
            style="height: 55px; padding: 15px 0; width: 450px"
          >
            <div class="title fs-16 fw-600">{{ item.title }}</div>
            <div class="num">
              <div class="text">
                <span class="fs-24 main-color fw-600">
                  <count-to
                    :startVal="0"
                    :endVal="Number(item.num) || 0"
                    :duration="3000"
                    :decimals="item.decimals"
                  ></count-to>
                </span>
                <!-- <span class="fs-14">{{ item.unit }}</span> -->
              </div>
            </div>
          </div>
        </div>
      </div>
      <!-- 案件监管指标部分完毕 -->

      <div class="mask-postion" v-if="isHideShow">
        <rankingDialog
          v-if="isHideShow"
          @isHide="changeHideShow"
        ></rankingDialog>
      </div>
    </div>
  </div>
</template>

<script>
// import {warningData} from "./fakeData"
import * as allData from "./fakeData";
import headtit from "../../components/title/title.vue";
import anhuiMap from "@/components/echart/anhuiMap";
import framemain from "../../components/frame/frame.vue";
import globalSupervisionSecond from "@/components/regulation/globalSupervisionSecond2";
import labelLineAdjust from "./labelLineAdjust";
import foldLine from "./foldLine";
import rankingDialog from "./rankingDialog.vue";

import major1 from "../../assets/crackDown/major1.png";
import major2 from "../../assets/crackDown/major2.png";
import major3 from "../../assets/crackDown/major3.png";
import major4 from "../../assets/crackDown/major4.png";
import major5 from "../../assets/crackDown/major5.png";

import money1 from "../../assets/crackDown/money1.png";
import money2 from "../../assets/crackDown/money2.png";

import jindu1 from "../../assets/img/jindu1.png";
import jindu2 from "../../assets/img/jindu2.png";
import jindu3 from "../../assets/img/jindu3.png";
import jindu4 from "../../assets/img/jindu4.png";
import jindu5 from "../../assets/img/jindu5.png";
import axios from "axios";
import { cityInfo, cityColor } from "@/mapdata/common.js";
import {getShortName} from '@/utils/convertName.js'

// import img5 from "../../assets/img/s-bg-purple.png";

// import echartsbar from './echartsbar.vue'
// import tousu from './tousu.vue'
// import xuke from './xuke.vue'
// new
import {
  getCaseTotal,
  getCaseValTotal,
  getQtyTotal,
  getCaseMapData,
  getJgNum,
  getCaseBmk,
  getBigCaseNum,
  getCityCaseBmk,
  getCountyCaseBmk,
  getSmokeMaSchineCity,
  getSmokeMaSchineCounty,
  getTobaccoLeafCity,
  getTobaccoLeafCounty,
  getLatelyCaseList,
  getQtyMaxTop10,
  getCigarQtyRanking,
} from "@/api/case.js";
import { getCaseTotalNum } from "@/api/common.js";
import timePicker from "@/components/timePicker/index.vue";
import CustomList from "@/components/mapList/mapList.vue";
import {
  getOutFlowTotalNum,
  getInFlowTotalNum,
} from "@/api/innerzon.js";
export default {
  data() {
    return {
      numData1: {},
      popData1: [],
      numData2: {},
      popData2: [],
      numData3: {},
      popData3: [],
      numData4: {},
      popData4: [],
      numData5: {},
      popData5: [],
      numData6: {},
      popData6: [],
      pingpainumData1: {},
      pingpaipopData1: [],
      pingpainumData2: {},
      pingpaipopData2: [],
      pingpainumData3: {},
      pingpaipopData3: [],
      pingpainumData4: {},
      pingpaipopData4: [],
      //案件对标数据
      caseBmk: {
        avgPersonFakeNumCity: [],
      },
      caseBmk1: {
        tobaccoLeafCityData: {},
        tobaccoLeafCountyData: {},
      },
      //地图区域
      clickArea: ["安徽省"],
      columnName: "prov_org_uuid",
      titleMap: {
        name: "安徽省",
        uuid: "00000000000000000000000011340001",
        level: 1,
        oldName: "安徽省",
        countyUuid: "",
      },
      placeList: [
        {
          name: "合肥市",
          value: [117.227239, 31.820587],
          isActive: false,
          uuid: "",
        },
      ],
      dataMaps: {
        安徽省: 340000,
        合肥市: 340100,
        瑶海区: 340102,
        庐阳区: 340103,
        蜀山区: 340104,
        包河区: 340111,
        长丰县: 340121,
        肥东县: 340122,
        肥西县: 340123,
        庐江县: 340124,
        巢湖市: 340181,
        芜湖市: 340200,
        镜湖区: 340202,
        鸠江区: 340207,
        弋江区: 340209,
        湾沚区: 340210,
        繁昌区: 340211,
        南陵县: 340223,
        无为市: 340281,
        蚌埠市: 340300,
        龙子湖区: 340302,
        蚌山区: 340303,
        禹会区: 340304,
        淮上区: 340311,
        怀远县: 340321,
        五河县: 340322,
        固镇县: 340323,
        淮南市: 340400,
        大通区: 340402,
        田家庵区: 340403,
        谢家集区: 340404,
        八公山区: 340405,
        潘集区: 340406,
        凤台县: 340421,
        寿县: 340422,
        马鞍山市: 340500,
        花山区: 340503,
        雨山区: 340504,
        博望区: 340506,
        当涂县: 340521,
        含山县: 340522,
        和县: 340523,
        淮北市: 340600,
        杜集区: 340602,
        相山区: 340603,
        烈山区: 340604,
        濉溪县: 340621,
        铜陵市: 340700,
        铜官区: 340705,
        义安区: 340706,
        郊区: 340711,
        枞阳县: 340722,
        安庆市: 340800,
        迎江区: 340802,
        大观区: 340803,
        宜秀区: 340811,
        怀宁县: 340822,
        太湖县: 340825,
        宿松县: 340826,
        望江县: 340827,
        岳西县: 340828,
        桐城市: 340881,
        潜山市: 340882,
        黄山市: 341000,
        屯溪区: 341002,
        黄山区: 341003,
        徽州区: 341004,
        歙县: 341021,
        休宁县: 341022,
        黟县: 341023,
        祁门县: 341024,
        滁州市: 341100,
        琅琊区: 341102,
        南谯区: 341103,
        来安县: 341122,
        全椒县: 341124,
        定远县: 341125,
        凤阳县: 341126,
        天长市: 341181,
        明光市: 341182,
        阜阳市: 341200,
        颍州区: 341202,
        颍东区: 341203,
        颍泉区: 341204,
        临泉县: 341221,
        太和县: 341222,
        阜南县: 341225,
        颍上县: 341226,
        界首市: 341282,
        宿州市: 341300,
        埇桥区: 341302,
        砀山县: 341321,
        萧县: 341322,
        灵璧县: 341323,
        泗县: 341324,
        六安市: 341500,
        金安区: 341502,
        裕安区: 341503,
        叶集区: 341504,
        霍邱县: 341522,
        舒城县: 341523,
        金寨县: 341524,
        霍山县: 341525,
        亳州市: 341600,
        谯城区: 341602,
        涡阳县: 341621,
        蒙城县: 341622,
        利辛县: 341623,
        池州市: 341700,
        贵池区: 341702,
        东至县: 341721,
        石台县: 341722,
        青阳县: 341723,
        宣城市: 341800,
        宣州区: 341802,
        郎溪县: 341821,
        泾县: 341823,
        绩溪县: 341824,
        旌德县: 341825,
        宁国市: 341881,
        广德市: 341882,
      },
      dataMap: require("../../mapdata/anhui/anhui.json"),
      regionsdata: [],
      cityInfo: cityInfo,
      // new
      // 重大案件
      bigCase: {
        listOne: {
          bdNum: 8,
          bzNum: 25,
        },
      },
      // 案件总览数据
      caseTotalPieData: [
        // { code: "specialCaseNum", name: "专车案件", value: 0 },
        // { code: "logisticsExpressCaseNum", name: "物流寄递案件", value: 0 },
        // { code: "produceCaseNum", name: "生产环节案件", value: 0 },
        // { code: "storageCaseNum", name: "仓储环节案件", value: 0 },
        // { code: "retailCaseNum", name: "零售环节案件", value: 0 },
        { code: "produceCaseNum", name: "生产", value: 0 },
        { code: "transportCaseNum", name: "运输", value: 0 },
        { code: "storageCaseNum", name: "仓储", value: 0 },
        { code: "distributionCaseNum", name: "分销", value: 0 },
        { code: "retailCaseNum", name: "零售", value: 0 },
        { code: "otherTacheCaseNum", name: "其他", value: 0 },
      ],
      // 案件总览-案件来源
      caseTotalFromPieData: [
        { code: "02", name: "市场查获", value: 0 },
        { code: "01", name: "投诉举报", value: 0 },
        { code: "03", name: "案件移交", value: 0 },
        { code: "04", name: "指定管辖", value: 0 },
        { code: "06", name: "其他", value: 0 },
      ],
      // 案值总览数据
      // 趋势图
      DataDM: [],
      DataA: [],
      caseValNums: {},
      bgImg: [
        require("../../assets/djds-new/ssaj/title.png"),
        // require("../../assets/djds-new/qbyj/title.png"),
        require("../../assets/djds-new/zl/aj.png"),
        require("../../assets/djds-new/zl/aj-active.png"),
        require("../../assets/djds-new/zl/az.png"),
        require("../../assets/djds-new/zl/az-active.png"),
        require("../../assets/djds-new/zl/wp.png"),
        require("../../assets/djds-new/zl/wp-active.png"),
        require("../../assets/djds-new/zl/ajzl/num-bg1.png"),
        require("../../assets/djds-new/zl/ajzl/num-bg2.png"),
        require("../../assets/djds-new/zdaj/title.png"),
        require("../../assets/djds-new/ajdb/title.png"),
        require("../../assets/djds-new/zyyl/title.png"),
        require("../../assets/djds-new/ajjg/title.png"),
        require("../../assets/djds-new/ajjg/title.png"),
        require("../../assets/djds-new/map-title.png"),
      ],
      // 0 案件总览 1 案值 2物品
      showType: 0,
      ajdbBtn: ["假私烟", "烟机", "烟叶烟丝"],
      // 0 卷烟案值 1 电子烟案值
      activeAzzlIndex: 0,
      ajzlBtn: ["卷烟案值", "电子烟案值"],
      activeAjdbIndex: 0,
      NewZYYL: {
        listOne: [
          {
            num: "846.44",
            unit: "",
            title2: "流出量(万支)",
          },
          {
            num: 57.37,
            unit: "%",
            title2: "同比",
          },
        ],
        listTwo: [
          {
            num: "370.47",
            unit: "",
            title2: "查获量(万支)",
          },
          {
            num: -2.2,
            unit: "%",
            title2: "同比",
          },
        ],
      },
      NewAJJG: {
        list: [
          {
            title: "临期案件数量",
            num: "70",
            unit: "个",
          },
          {
            title: "罚没物品处置超期",
            num: "2",
            unit: "个",
          },
          {
            title: "超期案件数量",
            num: "3",
            unit: "个",
          },
          {
            title: "平均立案时长",
            num: "10",
            unit: "日",
          },
          {
            title: "平均案件办理时长",
            num: "12",
            unit: "天",
          },
        ],
      },
      // old
      showPic: 0,
      btntext2: ["假私烟", "烟机", "烟丝烟叶"],
      currentIndex2: 0,
      nowDate: null,
      nowTime: null,
      timer: "",
      currentTime: new Date(),
      defaultDate: [
        "2023-01-01",
        new Date().toLocaleDateString().replace(/\//g, "-"),
      ],
      time: "",
      warningData: [],
      RealTimeCases: [],
      alertAliucheng: [
        {
          bgcolor: jindu1,
          name: "立案调查",
          math: 1240,
          id: 12,
          titname: "普通案件",
          left: "-16px",
          top: "-24px",
        },
        {
          bgcolor: jindu2,
          name: "审批决定",
          math: 758,
          id: 3,
          titname: "普通案件",
          left: "35px",
          top: "24px",
        },
        {
          bgcolor: jindu3,
          name: "送达执行",
          math: 133,
          id: 4,
          titname: "普通案件",
          left: "84px",
          top: "-23px",
        },
        {
          bgcolor: jindu4,
          name: "结案",
          math: 951,
          id: 1,
          titname: "普通案件",
          left: "132px",
          top: "24px",
        },
        {
          bgcolor: jindu5,
          name: "立案归档",
          math: 2758,
          id: 5,
          titname: "普通案件",
          left: "181px",
          top: "-22px",
        },
        {
          id: 6,
          name: "案件总共5840起",
          titname: "案件总共5840起",
          left: "231px",
          top: "0px",
          color: "#fff",
        },
      ],
      alertEliucheng: [
        {
          bgcolor: jindu1,
          name: "已立案调查",
          math: 102,
          id: 1,
          titname: "普通案件",
          left: "-16px",
          top: "-24px",
        },
        {
          bgcolor: jindu2,
          name: "检察院诉讼",
          math: 8,
          id: 2,
          titname: "普通案件",
          left: "79px",
          top: "24px",
        },
        {
          bgcolor: jindu5,
          name: "法院审判",
          math: 0,
          id: 5,
          titname: "普通案件",
          left: "176px",
          top: "-22px",
        },
        {
          id: 6,
          name: "案件总共110起",
          titname: "案件总共110起",
          left: "226px",
          top: "0px",
          color: "#fff",
        },
      ],
      isHideShow: false,
      mapData: [],
      currentIndex: 0,
      btntext: ["卷烟案值", "电子烟案值"],
      // labelLineObj1: {
      //   width: "50%",
      //   height: "100px",
      //   valueData: [
      //     { name: "真烟", value: "4245", proportion: "0.71%" },
      //     { name: "假烟", value: "1265", proportion: "-35.52%" },
      //     { name: "走私烟", value: "327", proportion: "256.61%" },
      //   ],
      // },
      // labelLineObj2: {
      //   width: "50%",
      //   height: "100px",
      //   seriesCenter: ["30%", "50%"],
      //   valueData: allData.inProgressElectronicCigarette,
      // },
      labelLineObj3: {
        radius: ["70%", "95%"],
        subtext: "万元",
        centerText: true,
        width: "100%",
        height: "120px",
        titleText: 0,
        valueData: [],
        type: "2",
      },
      labelLineObj4: {
        radius: ["70%", "95%"],
        subtext: "万元",
        width: "100%",
        height: "120px",
        centerText: true,
        titleText: 0,
        valueData: [],
        type: "2",
        seriesCenter: ["30%", "50%"],
        titleX: "68%",
        legendLeft: "55%",
      },
      labelLineObj5: {
        radius: ["70%", "95%"],
        centerText: true,
        titleText: 0,
        subtext: "万支",
        legendRight: "10%",
        width: "100%",
        height: "120px",
        type: "3",
        valueData: [],
      },
      labelLineObj6: {
        radius: ["70%", "95%"],
        centerText: true,
        titleText: 0,
        subtext: "万个",
        legendLeft: "55%",
        width: "100%",
        height: "120px",
        type: "4",
        valueData: [],
      },
      articleList: {
        list: [
          {
            code: "cigarQtyYearOnYear",
            text: "卷烟数量(万支)",
            value: 0,
            num: 0,
            decimals: 2,
            unit: "万支",
          },
          // { text: "雪茄烟数量", value: "478.72", num: "367.04", unit: "%" },
          {
            code: "tobaccoLeafQtyYearOnYear",
            text: "烟叶烟丝数量(公斤)",
            value: 0,
            num: 0,
            decimals: 2,
            unit: "",
          },
          {
            code: "ecigarTotalQtyYearOnYear",
            text: "电子烟数量(万个)",
            value: 0,
            num: 0,
            decimals: 2,
            unit: "",
          },
          {
            code: "smokeMachineQtyYearOnYear",
            text: "烟机数量(台)",
            value: 0,
            num: 0,
            decimals: 0,
            unit: "",
          },
          // {
          //   text: "加热不燃烧数量",
          //   value: "9380",
          //   num: "100",
          //   unit: "%",
          //   type: "个",
          // },
        ],
      },
      pingpai: [
        {
          name: "卷烟案值(万元)",
          num: 0,
          per: 0,
        },
        {
          name: "烟叶烟丝案值(万元)",
          num: 0,
          per: 0,
        },
        {
          name: "电子烟案值(万元)",
          num: 0,
          per: 0,
        },
        {
          name: "烟机案值(万元)",
          num: 0,
          per: 0,
        },
      ],
      totalList: [
        {
          name: "刑拘人数",
          num: 662,
        },
        {
          name: "逮捕人数",
          num: 208,
        },
        {
          name: "判刑人数",
          num: 236,
        },
      ],
      // 全域监管
      globalSuperData: {
        list: [
          {
            name: "网络案件",
            num: 0,
            radio: 0,
            radioName: "有价信息率",
            id: "aj-second0",
          },
          {
            name: "省标案件",
            num: 0,
            radio: 0,
            radioName: "有价信息率",
            id: "aj-second1",
          },
          {
            name: "国标案件",
            num: 0,
            radio: 0,
            radioName: "形成案件率",
            id: "aj-second2",
          },
        ],
      },
      tjaj: {
        list: [
          {
            name: "特大案件(起)",
            num: 0,
            img: major1,
          },
          {
            name: "一级案件(起)",
            num: 1,
            img: major2,
          },
          {
            name: "二级案件(起)",
            num: 6,
            img: major3,
          },
          {
            name: "三级案件(起)",
            num: 14,
            img: major4,
          },
          {
            name: "四级案件(起)",
            num: 4,
            img: major5,
          },
        ],
      },
      caseTotalObj: {
        total: {
          num: 0,
          per: 0,
        },
        list: [
          {
            num: 0,
            per:0,
            code:'easyCaseNum',
            title: "简易案件(起)",
          },
          {
            num: 0,
            per:0,
            code:'caseNum',
            title: "普通案件(起)",
          },
          {
            num: 0,
            per:0,
            code:'transferPoliceCaseNum',
            title: "移送公安机关案件(起)",
          },
          {
            num: 0,
            per:0,
            code:'transfeOtherCaseNum',
            title: "移送其他行政机关案件(起)",
          },
          /*  {
            num: 0,
            title: "5万元以上案件",
          },
          {
            num: 0,
            title: "举报投诉案件",
          },
          {
            num: 0,
            title: "市场查获案件",
          },
          {
            num: 0,
            title: "其他案件",
          }, */
        ],
      },
      caseTotalnumData1:{},
      caseTotalpopData1:{},
      caseTotalnumData2:{},
      caseTotalpopData2:{},
      caseTotalnumData3:{},
      caseTotalpopData3:{},
      caseTotalnumData4:{},
      caseTotalpopData4:{},
      config: {
        waitTime: "2000",
        oddRowBGC: "rgba(41, 138, 255, 0.15)",
        evenRowBGC: "rgba(41, 138, 255, 0.15)",
        columnWidth: [100, 50],
        rowNum: 6,
        data: allData.warningData,
      },
      picktimeTemp: {},
      ItemOverview: "",
      QtyMaxTopTen: [],
      CigarQtyRankings: [],
      LeftListTitle: "查获假私烟品牌排名",
      LeftListColumns: [],
      LeftListItems: [],
      RightListTitle: "查获卷烟数量排名",
      RightListColumns: [],
      RightListItems: [],
    };
  },

  computed: {
    scrollOption() {
      return {
        // step: 0.2,
        // hoverStop: true, // 是否开启鼠标悬停stop
        // direction: 1, // 0向下 1向上 2向左 3向右
        // openWatch: true, // 开启数据实时监控刷新dom
        // singleHeight: 34, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        // waitTime: 2000, // 单步运动停止的时间(默认值1000ms)
        step: 0.2,
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        waitTime: 3000, // 单步运动停止的时间(默认值1000ms)
        limitMoveNum: 0,
      };
    },
  },
  components: {
    headtit,
    framemain,
    // echartsbar,
    // tousu,
    // xuke,
    anhuiMap,
    labelLineAdjust,
    globalSupervisionSecond,
    foldLine,
    rankingDialog,
    timePicker,
    CustomList,
  },
  created() {
    // this.timer = setInterval(this.getTime, 1000);
    // this.initData(
    //   "prov_org_uuid",
    //   "00000000000000000000000011340001",
    //   "安徽省"
    // );
    localStorage.setItem("mapLevel",1);
    localStorage.setItem("columnName",'prov_org_uuid');
    localStorage.setItem("orgUuid",'00000000000000000000000011340001');
  },
  mounted() {
    this.time = this.getNowDate();
    // let _this = this;
    // window.addEventListener("setItemEvent", (event) => {
    //   if (event.key === "PICKTIME") {
    //     // console.log(event.newValue);
    //     _this.picktimeTemp = JSON.parse(event.newValue);
    //     if (_this.titleMap.level === 1) {
    //       _this.initData(
    //         "prov_org_uuid",
    //         _this.titleMap.uuid,
    //         _this.titleMap.name
    //       );
    //     } else if (_this.titleMap.level === 2) {
    //       _this.initData(
    //         "city_org_uuid",
    //         _this.titleMap.uuid,
    //         _this.titleMap.name
    //       );
    //     } else {
    //       _this.initData(
    //         "county_org_uuid",
    //         _this.titleMap.uuid,
    //         _this.titleMap.name
    //       );
    //     }
    //   }
    // });
    // 案件对标echarts
    // this.barInit("jsy-box");
  },
  watch: {
    "titleMap.uuid": {
      handler(newVal, oldVal) {
        localStorage.setItem("mapUuid", newVal);
      },
      immediate: true,
    },
    "columnName": {
      handler(newVal, oldVal) {
        localStorage.setItem("columnName", newVal);
      },
      immediate: true,
    },
  },
  metaInfo: {
    meta: [{ name: "referrer", content: "no-referrer" }],
  },
  methods: {
    timeChangeFn(timeObj) {
      console.log(timeObj, "timeobj------------");
      sessionStorage.setItem("djdsTimObj", JSON.stringify(timeObj));
      this.picktimeTemp = timeObj;
      if (this.titleMap.level === 1) {
        this.initData("prov_org_uuid", this.titleMap.uuid, this.titleMap.name);
      } else if (this.titleMap.level === 2) {
        this.initData("city_org_uuid", this.titleMap.uuid, this.titleMap.name);
      } else {
        this.initData(
          "county_org_uuid",
          this.titleMap.uuid,
          this.titleMap.name
        );
      }
    },
    // 地图返回
    mapBack(index) {
      let that = this;
      that.titleMap.level = index + 1;
      that.overview(0);
      if (that.titleMap.level == 1) {
        that.clickArea = [];

        that.titleMap.name = "安徽省";
        that.titleMap.uuid = "00000000000000000000000011340001";
        that.clickArea.push(that.titleMap.name);
        console.log(that.titleMap, "地图返回,");
        that.initData("prov_org_uuid", that.titleMap.uuid, that.titleMap.name);
      } else if (that.titleMap.level == 2) {
        if (that.titleMap.level < that.clickArea.length) that.clickArea.pop();
        if (that.clickArea.length == 3) that.clickArea.pop();
        console.log(that.titleMap, "返回地市");
        that.initData(
          "city_org_uuid",
            that.titleMap.cityUuid,
          that.titleMap.oldName
        );
      } else if (that.titleMap.level == 3) {
        if (that.clickArea.length == 4) that.clickArea.pop();
        console.log(that.titleMap, "返回县区");
        that.initData(
          "county_org_uuid",
          that.titleMap.countyUuid,
          that.titleMap.name
        );
      }
    },
    //初始化数据
    initData(columnName, orgUuid, name) {
      let that = this;
      that.columnName = columnName;
      that.titleMap.uuid = orgUuid;
      let limit = 10;
      const req1 = getCaseTotal({
        ...that.picktimeTemp,
        columnName,
        orgUuid,
      });
      let date = new Date();
      let year = date.getFullYear();
      let month = date.getMonth() + 1;
      // let timeObj = {
      //   startDate: year + "-01-01",
      //   endDate: year + "-" + month + "-01",
      //   lastStartDate: year - 1 + "-01-01",
      //   lastEndDate: year - 1 + "-" + month + "-01",
      // };
      const req2 = getCaseValTotal({
        ...that.picktimeTemp,
        trendStartDate: year - 10 + "-01-01",
        trendEndDate: year + "-" + month + "-01",
        columnName,
        orgUuid,
      });
      const req3 = getQtyTotal({
        ...that.picktimeTemp,
        columnName,
        orgUuid,
      });
      const req4 = getCaseMapData({
        ...that.picktimeTemp,
        columnName,
        orgUuid,
      });
      const req5 = getBigCaseNum({
        ...that.picktimeTemp,
        columnName,
        limit: "10",
        year: year,
        orgUuid,
        lastYear: year - 1,
        yearBeforeLast: year - 2,
      });
      const req6 = getJgNum({
        ...that.picktimeTemp,
        columnName,
        orgUuid,
      });
      // 案件对标接口

      let req7 = null;
      let req8 = null;
      let req9 = null;
      if (that.titleMap.level === 1) {
        req7 = getCaseBmk({
          //  ...that.picktimeTemp,
          year: year,
          half: "01",
          // columnName,
          // orgUuid,
        });
      } else if (that.titleMap.level === 2) {
        req7 = getCityCaseBmk({
          ...that.picktimeTemp,
          orgUuid,
          limit: 10,
          year,
          month,
        });
        req8 = getTobaccoLeafCity({
          ...that.picktimeTemp,
          orgUuid: "00000000000000000000000011340001",
          limit: 10,
          year,
          month,
        });
      } else if (that.titleMap.level === 3) {
        console.log(that.titleMap, "sadasdasdasd");
        req7 = getCountyCaseBmk({
          ...that.picktimeTemp,
          columnName: "prov_org_uuid",
          cityOrgUuid: that.titleMap.uuid,

          year,
          month,
        });
        req8 = getTobaccoLeafCounty({
          ...that.picktimeTemp,
          columnName: "prov_org_uuid",
          cityOrgUuid: that.titleMap.uuid,

          year,
          month,
        });
      }

      let req10 = getLatelyCaseList({
        ...that.picktimeTemp,
        columnName,
        orgUuid,
        limit: 10,
      });

      let req11 = getQtyMaxTop10({
        ...that.picktimeTemp,
        columnName,
        orgUuid,
      });

      let req12 = getCigarQtyRanking({
        ...that.picktimeTemp,
        columnName,
        orgUuid,
      });
      const req13 = getOutFlowTotalNum({
        ...that.picktimeTemp,
        columnName:"prov_org_uuid",
        columnName2:"city_org_uuid",
        columnName3:"city_org_name",
        orgUuid,
      });
      const req14 = getInFlowTotalNum({
        ...that.picktimeTemp,
        columnName:"prov_org_uuid",
        columnName2:"city_org_uuid",
        columnName3:"city_org_name",
        orgUuid,
      });
      Promise.all([
        req1,
        req2,
        req3,
        req4,
        req5,
        req6,
        req7,
        req8,
        req10,
        req11,
        req12,
        req13,
        req14,
      ])
        .then(function (results) {
        //实时案件
        that.RealTimeCases = results[8].latelyCaseList.data;
          // 案件总览
          const data1 = results[0];
          console.log(data1, "案件总览");
          that.caseTotalObj.total = {
            num: data1.caseNum.data[0].num,
            per: data1.caseNum.data[0].yearOnYear,
          };
          that.numData6 = {
            num: that.caseTotalObj.total.num,
            decimals: 0,
            suffix: "",
          };
          that.popData6 = [
            {
              label: "同比",
              value: that.caseTotalObj.total.per,
              imgSrc: 
                that.caseTotalObj.total.per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.caseTotalObj.total.per < 0 ? "danger-color" : "safe-color",
            },
          ];
          that.caseTotalObj.list.forEach(item=>{
            let its= data1.caseClassify.data.find(it=>it.classify==item.code)
            item.num=its.num
            item.per=its.yearOnYear
          })
          // console.log('66666',that.caseTotalObj.list);
          that.caseTotalnumData1 = {
            num: that.caseTotalObj.list[0].num,
            decimals: 0,
            suffix: "",
          };
          that.caseTotalpopData1 = [
            {
              label: "同比",
              value: that.caseTotalObj.list[0].per,
              imgSrc:
                that.caseTotalObj.list[0].per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.caseTotalObj.list[0].per < 0 ? "danger-color" : "safe-color",
            },
          ];
          that.caseTotalnumData2 = {
            num: that.caseTotalObj.list[1].num,
            decimals: 0,
            suffix: "",
          };
          that.caseTotalpopData2 = [
            {
              label: "同比",
              value: that.caseTotalObj.list[1].per,
              imgSrc:
                that.caseTotalObj.list[1].per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.caseTotalObj.list[1].per < 0 ? "danger-color" : "safe-color",
            },
          ];
          that.caseTotalnumData3 = {
            num: that.caseTotalObj.list[2].num,
            decimals: 0,
            suffix: "",
          };
          that.caseTotalpopData3 = [
            {
              label: "同比",
              value: that.caseTotalObj.list[2].per,
              imgSrc:
                that.caseTotalObj.list[2].per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.caseTotalObj.list[2].per < 0 ? "danger-color" : "safe-color",
            },
          ];
          that.caseTotalnumData4 = {
            num: that.caseTotalObj.list[3].num,
            decimals: 0,
            suffix: "",
          };
          that.caseTotalpopData4 = [
            {
              label: "同比",
              value: that.caseTotalObj.list[3].per,
              imgSrc:
                that.caseTotalObj.list[3].per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.caseTotalObj.list[3].per < 0 ? "danger-color" : "safe-color",
            },
          ];
          // that.labelLineObj1.valueData =
          // that.labelLineObj2.valueData =
          that.caseTotalPieData.forEach(
            (k) => (k.value = data1.caseSchema.data[0][k.code])
          );
      
          const FromName = {
            "01": "投诉举报",
            "02": "市场查获",
            "03": "案件移交",
            "04": "指定管辖",
            "06": "其他",
          };
          // console.log('123456',data1.caseSourceNum.data);
          that.caseTotalFromPieData.forEach(
            (k) => {
              const its = data1.caseSourceNum.data.find(it=> it.case_source==k.code)
              console.log('its',its);
              if(its){
                k.value = its.num
              }else{
                k.value =0
              }
            }
          );
          // console.log('78910',that.caseTotalFromPieData);
          that.initpie();
          that.initFromPie();
          that.caseValNums = results[1];
          // that.caseValNums.cigarValYearOnYear.data[0].yearOnYear = "-";
          that.numData5 = {
            num: that.caseValNums.cigarValTotalOnYear.data[0].num,
            decimals: 2,
            suffix: "",
          };
          that.popData5 = [
            {
              label: "同比",
              value: that.caseValNums.cigarValTotalOnYear.data[0].yearOnYear,
              imgSrc:
                that.caseValNums.cigarValTotalOnYear.data[0].yearOnYear != "-"
                  ? require("../../assets/common-new/green-top.png")
                  : "",
              unit: "%",
              color:
                that.caseValNums.cigarValTotalOnYear.data[0].yearOnYear != "-"
                  ? "safe-color"
                  : " ",
            },
          ];
          console.log(that.caseValNums, "案值总览");
          // 案值总览饼图
          that.labelLineObj3.valueData=[]
          that.labelLineObj4.valueData=[]
          that.caseValNums.trueFlaseSmuggleVal.data.map((item) => {
            that.labelLineObj3.valueData.push(
              Object.assign({}, item, { value: item.num })
            );
          });
          that.labelLineObj3.titleText =
            that.caseValNums.trueFlaseSmuggleVal.data
              .reduce((pre, cur) => pre + cur.num, 0)
              .toFixed(2);
          that.caseValNums.ecigarVal.data.map((item) => {
            that.labelLineObj4.valueData.push(
              Object.assign({}, item, { value: item.num })
            );
          });
          console.log(' that.labelLineObj3',that.labelLineObj3);
          that.labelLineObj4.titleText = that.caseValNums.ecigarVal.data
            .reduce((pre, cur) => pre + cur.num, 0)
            .toFixed(2);
          that.labelLineObj4.valueData.forEach((k) => {
            if (k.name === "电子烟（一次性）") {
              k.name = "  电子烟\n(一次性)";
            }
          });
          console.log(' that.labelLineObj4',that.labelLineObj4);

          console.log(
            that.caseValNums.tobaccoLeafValYearOnYear.data[0].num,
            "that.caseValNums.tobaccoLeafValYearOnYear.data[0].numthat.caseValNums.tobaccoLeafValYearOnYear.data[0].num"
          );
          that.pingpai = [
            {
              name: "卷烟案值(万元)",
              num: that.caseValNums.cigarValYearOnYear.data[0].num,
              per: that.caseValNums.cigarValYearOnYear.data[0].yearOnYear,
            },
            {
              name: "烟叶烟丝案值(万元)",
              num: that.caseValNums.tobaccoLeafValYearOnYear.data[0].num,
              per: that.caseValNums.tobaccoLeafValYearOnYear.data[0].yearOnYear,
            },
            {
              name: "电子烟案值(万元)",
              num: that.caseValNums.ecigarTotalValYearOnYear.data[0].num,
              per: that.caseValNums.ecigarTotalValYearOnYear.data[0].yearOnYear,
            },
            {
              name: "烟机案值(万元)",
              num: that.caseValNums.smokeMachineValYearOnYear.data[0].num,
              per: that.caseValNums.smokeMachineValYearOnYear.data[0]
                .yearOnYear,
            },
          ];
          that.pingpainumData1 = {
            num: that.pingpai[0].num,
            decimals: 2,
            suffix: "",
          };
          that.pingpaipopData1 = [
            {
              label: "同比",
              value: that.pingpai[0].per,
              imgSrc:
                that.pingpai[0].per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.pingpai[0].per < 0 ? "danger-color" : "safe-color",
            },
          ];
          that.pingpainumData2 = {
            num: that.pingpai[1].num,
            decimals: 2,
            suffix: "",
          };
          that.pingpaipopData2 = [
            {
              label: "同比",
              value: that.pingpai[1].per,
              imgSrc:
                that.pingpai[1].per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.pingpai[1].per < 0 ? "danger-color" : "safe-color",
            },
          ];
          that.pingpainumData3 = {
            num: that.pingpai[2].num,
            decimals: 2,
            suffix: "",
          };
          that.pingpaipopData3 = [
            {
              label: "同比",
              value: that.pingpai[2].per,
              imgSrc:
                that.pingpai[2].per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.pingpai[2].per < 0 ? "danger-color" : "safe-color",
            },
          ];
          that.pingpainumData4 = {
            num: that.pingpai[3].num,
            decimals: 2,
            suffix: "",
          };
          that.pingpaipopData4 = [
            {
              label: "同比",
              value: that.pingpai[3].per,
              imgSrc:
                that.pingpai[3].per < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color: that.pingpai[3].per < 0 ? "danger-color" : "safe-color",
            },
          ];
          // 物品总览
          const data3 = results[2];
          that.ItemOverview = results[2];
          console.log(data3, "物品总览");
          that.articleList.list.forEach((k) => {
            k.value = data3[k.code].data[0].num;
            k.num = data3[k.code].data[0].yearOnYear;
            k.unit = k.unit === "万支" ? "万支" : data3[k.code].data[0].unit;
            if (k.code === "ecigarTotalQtyYearOnYear") {
              k.value = (Math.ceil(k.value / 100) / 100).toFixed(2);
            }
          });
          console.log("articleList.list", that.articleList.list);
          that.$forceUpdate();
          that.numData1 = {
            num: that.articleList.list[0].value,
            decimals: that.articleList.list[0].decimals,
            suffix: "",
          };
          that.popData1 = [
            {
              label: "同比",
              value: that.articleList.list[0].num,
              imgSrc:
                that.articleList.list[0].num < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color:
                that.articleList.list[0].num < 0
                  ? "danger-color"
                  : "safe-color",
            },
          ];
          that.numData2 = {
            num: that.articleList.list[1].value,
            decimals: that.articleList.list[1].decimals,
            suffix: "",
          };
          that.popData2 = [
            {
              label: "同比",
              value: that.articleList.list[1].num,
              imgSrc:
                that.articleList.list[1].num < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color:
                that.articleList.list[1].num < 0
                  ? "danger-color"
                  : "safe-color",
            },
          ];
          that.numData3 = {
            num: that.articleList.list[2].value,
            decimals: that.articleList.list[2].decimals,
            suffix: "",
          };
          that.popData3 = [
            {
              label: "同比",
              value: that.articleList.list[2].num,
              imgSrc:
                Number(that.articleList.list[2].num) < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color:
                Number(that.articleList.list[2].num) < 0
                  ? "danger-color"
                  : "safe-color",
            },
          ];
          that.numData4 = {
            num: that.articleList.list[3].value,
            decimals: that.articleList.list[3].decimals,
            suffix: "",
          };
          that.popData4 = [
            {
              label: "同比",
              value: that.articleList.list[3].num,
              imgSrc:
                Number(that.articleList.list[3].num) < 0
                  ? require("../../assets/common-new/red-down.png")
                  : require("../../assets/common-new/green-top.png"),
              unit: "%",
              color:
                Number(that.articleList.list[3].num) < 0
                  ? "danger-color"
                  : "safe-color",
            },
          ];
          that.labelLineObj5.valueData=[]
          that.labelLineObj6.valueData=[]
          data3.trueFlaseSmuggleQty.data.map((item) => {
            that.labelLineObj5.valueData.push(
              Object.assign({}, item, {
                value: item.num,
                // ,proportion:item.
              })
            );
          });
          that.$forceUpdate();

          that.labelLineObj5.titleText = data3.trueFlaseSmuggleQty.data
            .reduce((pre, cur) => pre + cur.num, 0)
            .toFixed(2);

          data3.ecigarQty.data.map((item) => {
            that.labelLineObj6.valueData.push(
              Object.assign({}, item, {
                value: item.num,
                // ,proportion:item.
              })
            );
          });
          that.labelLineObj6.titleText = data3.ecigarQty.data
            .reduce((pre, cur) => pre + cur.num, 0)
            .toFixed(2);
          // 地图数据

          const data4 = results[3];
          console.log(data4, "地图数据");
          const mapd = {
            阜阳市: ["颍州区", "颍东区", "颍泉区"],
            宿州市: ["埇桥区"],
            淮北市: ["烈山区", "相山区", "杜集区"],
            蚌埠市: ["淮上区", "龙子湖区", "蚌山区", "禹会区"],
            淮南市: ["谢家集", "八公山", "田家庵", "大通"],
            滁州市: ["南谯区", "琅琊区"],
            六安市: ["裕安区", "金安区"],
            马鞍山市: ["花山区", "雨山区", "博望区"],
            芜湖市: ["鸠江区", "弋江区", "镜湖区"],
            铜陵市: ["郊区", "铜官区"],
            安庆市: ["大观区", "宜秀区", "迎江区"],
          };
          var mapa = [];

          that.mapData = [];
          data4.forMap.data.map((item) => {
            if (
              item.cityName == "阜阳市烟草专卖局直属分局" ||
              item.cityName == "马鞍山市烟草专卖局钢城分局" ||
              item.cityName == "六安市烟草专卖局皋城分局" ||
              item.cityName == "滁州市烟草专卖局直属分局" ||
              item.cityName == "蚌埠市烟草专卖局直属分局" ||
              item.cityName == "淮北市烟草专卖局直属分局" ||
              item.cityName == "宿州市烟草专卖局直属分局" ||
              item.cityName == "淮南市烟草专卖局谢家集八公山分局" ||
              item.cityName == "芜湖市烟草专卖局直属分局" ||
              item.cityName == "芜湖市烟草专卖局江北分局" ||
              item.cityName == "铜官区烟草专卖局" ||
              item.cityName == "宜城烟草专卖局" ||
              item.cityName == "淮南市烟草专卖局田家庵大通分局"
            ) {
              mapa.push(item);
            } else {
              that.mapData.push(
                Object.assign({}, item, {
                  name:
                    that.titleMap.level != 1
                      ? item.cityName
                          .replace("烟草专卖局", "")
                          .replace("合肥市", "")
                          .replace("淮南市", "")
                          .replace("亳州市", "")
                          .replace("黄山市", "")
                          .replace("芜湖市", "")
                          .replace("安徽省", "")
                          .replace("分局", "区")
                      : item.cityName.replace("烟草专卖局", ""),
                  value: item.caseNum,
                  value1: item.fiveCaseNum,
                  value2: item.caseTotalQty,
                  value3: item.caseTotalVal,
                })
              );
            }
          });
          if (
            that.titleMap.level != 1 &&
            (mapd[that.titleMap.oldName] != null ||
              typeof mapd[that.titleMap.oldName] != "undefined")
          ) {
            mapd[that.titleMap.oldName].forEach((item) => {
              if (that.titleMap.oldName == "淮南市") {
                let k = mapa.find((k2) => k2.cityName.includes(item));
                console.log(k, "地图数据pasdaro");
                that.mapData.push(
                  Object.assign({}, k, {
                    name: item + "区",
                    value: k?.caseNum,
                    value1: k?.fiveCaseNum,
                    value2: k?.caseTotalQty,
                    value3: k?.caseTotalVal,
                  })
                );
              } else if (that.titleMap.oldName == "芜湖市") {
                let k = {};
                if (item == "鸠江区")
                  k = mapa.find((k2) => k2.cityName.includes("江北分局"));
                else k = mapa.find((k2) => k2.cityName.includes("直属分局"));
                console.log(k, "地图数据pasdaro");
                that.mapData.push(
                  Object.assign({}, k, {
                    name: item,
                    value: k?.caseNum,
                    value1: k?.fiveCaseNum,
                    value2: k?.caseTotalQty,
                    value3: k?.caseTotalVal,
                  })
                );
              }else {
                that.mapData.push(
                  Object.assign({}, mapa[0], {
                    name: item,
                    value: mapa[0]?.caseNum ?? 0,
                    value1: mapa[0]?.fiveCaseNum ?? 0,
                    value2: mapa[0]?.caseTotalQty ?? 0,
                    value3: mapa[0]?.caseTotalVal ?? 0,
                  })
                );
              }
            });
          }
          let addres = that.dataMaps[name];
          if (that.titleMap.level == 1 || that.titleMap.level == 2) {
            addres += "_full.json";
          } else {
            addres += ".json";
          }
          axios
            .get("https://geo.datav.aliyun.com/areas_v3/bound/" + addres)
            .then(function (res) {
              that.dataMap = res.data;
              console.log('that.dataMap',that.dataMap);
              that.mapCrackDown("centerMap");
              // that.clickArea.push()
            })
            .catch(function (error) {
              console.log(error);
            });
          // 重大案件
          // 部督案件
          const data5 = results[4];
          console.log(data5, "重大案件");
          if (that.titleMap.level === 3) {
            that.bigCase = {
              listOne: {
                bdNum: 0,
                bzNum: 0,
              },
            };
            that.tjaj = {
              list: [
                {
                  name: "特大案件(起)",
                  num: 0,
                  img: major1,
                },
                {
                  name: "一级案件(起)",
                  num: 0,
                  img: major2,
                },
                {
                  name: "二级案件(起)",
                  num: 0,
                  img: major3,
                },
                {
                  name: "三级案件(起)",
                  num: 0,
                  img: major4,
                },
                {
                  name: "四级案件(起)",
                  num: 0,
                  img: major5,
                },
              ],
            };
            (that.totalList = [
              {
                name: "刑拘人数",
                num: 0,
              },
              {
                name: "逮捕人数",
                num: 0,
              },
              {
                name: "判刑人数",
                num: 0,
              },
            ]),
              (that.globalSuperData = {
                list: [
                  {
                    name: "网络案件",
                    num: 0,
                    radio: 0,
                    radioName: "有价信息率",
                    id: "aj-second0",
                  },
                  {
                    name: "省标案件",
                    num: 0,
                    radio: 0,
                    radioName: "有价信息率",
                    id: "aj-second1",
                  },
                  {
                    name: "国标案件",
                    num: 0,
                    radio: 0,
                    radioName: "形成案件率",
                    id: "aj-second2",
                  },
                ],
              });
          } else {
            that.bigCase = {
              listOne: {
                bdNum: data5.importanceCaseData.data[0]?.bjdbCaseNum ?? 0,
                bzNum: data5.importanceCaseData.data[0]?.gjjbzCaseNum ?? 0,
              },
            };
            that.tjaj = {
              list: [
                {
                  name: "特大案件(起)",
                  num: data5.importanceCaseData.data[0]?.tdCaseNum ?? 0,
                  img: major1,
                },
                {
                  name: "一级案件(起)",
                  num: data5.importanceCaseData.data[0]?.level1CaseNum ?? 0,
                  img: major2,
                },
                {
                  name: "二级案件(起)",
                  num: data5.importanceCaseData.data[0]?.level2CaseNum ?? 0,
                  img: major3,
                },
                {
                  name: "三级案件(起)",
                  num: data5.importanceCaseData.data[0]?.level3CaseNum ?? 0,
                  img: major4,
                },
                {
                  name: "四级案件(起)",
                  num: data5.importanceCaseData.data[0]?.level4CaseNum ?? 0,
                  img: major5,
                },
              ],
            };
            (that.totalList = [
              {
                name: "刑拘人数",
                num: data5.netCasePersonData.data[0]?.xjNum ?? 0,
              },
              {
                name: "逮捕人数",
                num: data5.netCasePersonData.data[0]?.dbNum ?? 0,
              },
              {
                name: "判刑人数",
                num: data5.netCasePersonData.data[0]?.pxNum ?? 0,
              },
            ]),
              (that.globalSuperData = {
                list: [
                  {
                    name: "网络案件",
                    num: data5.netCaseData.data[0]?.netCaseNum ?? 0,
                    radio: data5.netCaseData.data[0]?.netCaseNumYearOnYear ?? 0,
                    radioName: "有价信息率",
                    id: "aj-second0",
                  },
                  {
                    name: "省标案件",
                    num: data5.netCaseData.data[0]?.provinceCaseNum ?? 0,
                    radio: data5.netCaseData.data[0]?.provinceCaseNumYearOnYear ?? 0,
                    radioName: "有价信息率",
                    id: "aj-second1",
                  },
                  {
                    name: "国标案件",
                    num: data5.netCaseData.data[0]?.nationCaseNum ?? 0,
                    radio: data5.netCaseData.data[0]?.nationCaseNumYearOnYear ?? 0,
                    radioName: "形成案件率",
                    id: "aj-second2",
                  },
                ],
              });
          }

          that.$nextTick(() => {
            that.$refs["aj-second0"][0].echartsInit();
            that.$refs["aj-second1"][0].echartsInit();
            that.$refs["aj-second2"][0].echartsInit();
          });
          // 案件监管指标
          const data6 = results[5];
          console.log(data6, "案件监管指标");
          that.NewAJJG = {
            list: [
              {
                decimals: 0,
                title: "临期案件数量(起)",
                num: data6.warnData.data[0]?.num || 0,
                unit: "日",
              },
              {
                decimals: 0,
                title: "罚没物品处置超期(起)",
                num: data6.warnData.data[1]?.num || 0,

                unit: "日",
              },
              {
                decimals: 0,
                title: "超期案件数量(起)",
                num: data6.warnData.data[2]?.num || 0,

                unit: "日",
              },
              {
                decimals: 2,
                title: "平均立案时长(日)",
                num: data6.regCaseDay.data[0]?.avgRegCaseDays || 0,
                unit: "日",
              },
              {
                decimals: 2,
                title: "平均案件办理时长(天)",
                num: data6.handleDay.data[0]?.num || 0,
                unit: "天",
              },
              /*  {
                decimals: 2,
                title: "平均处罚执行时长(日)",
                num: data6.punishDay.data[0]?.num,
                unit: "日",
              }, */
            ],
          };
          const data7 = results[6];
          console.log(data7, "案件对标数据");
          that.caseBmk = data7;
          const data8 = results[7];
          console.log(data8, "案件对标数据烟叶烟丝");
          that.caseBmk1=data8;
          that.toggleBtn(0);
          that.barInit("jsy-box");

          that.RealTimeCases = results[8].latelyCaseList.data;
          console.log("实事案件", that.RealTimeCases);

          const data10=results[9]
          that.QtyMaxTopTen = results[9].qtyMaxTop10.data;
          // that.LeftListTitle = data10.qtyMaxTop10.name
          that.LeftListColumns = data10.colDef.data.sort((sta,next)=>{
            return sta.colOrder - next.colOrder
          }).map(k=>k.colName)
          that.LeftListItems = [];
          that.QtyMaxTopTen.forEach((item) => {
            that.LeftListItems.push({
              col1: item.ranking,
              col2: item.goods_name,
              col3: item.num,
            });
          });

          console.log("当年查获卷烟数量最多的10个品牌", that.QtyMaxTopTen);

          const data11=results[10]
          that.CigarQtyRankings = results[10].cigarQtyRanking.data;
          // that.RightListTitle = data11.cigarQtyRanking.name
          that.RightListColumns = data11.colDef.data.sort((sta,next)=>{
            return sta.colOrder - next.colOrder
          }).map(k=>k.colName)
          that.RightListItems = [];
          console.log("单位查获卷烟数量排名", that.CigarQtyRankings);
          that.CigarQtyRankings.forEach((item) => {
            that.RightListItems.push({
              col1: item.ranking,
              col2: item.orgName,
              col3: item.num,
            });
          });


          //真烟异流
          console.log(results[12],"真烟异流流出")
          const data13=results[12]?.inflowTotalNumYearonyear.data;
           const data14=results[11]?.outflowTotalNumYearonyear.data;
          
          console.log(results[11],"真烟异流查获")
          debugger;
          that.NewZYYL.listTwo[0].num=data13[0]?.cigarNum?data13[0]?.cigarNum:'-';
          that.NewZYYL.listTwo[1].num=data13[0]?.yearOnYear?data13[0]?.yearOnYear:'-';
          that.NewZYYL.listOne[0].num=data14[0]?.cigarNum?data14[0]?.cigarNum:'-';
          that.NewZYYL.listOne[1].num=data14[0]?.yearOnYear?data14[0]?.yearOnYear:'-';
        })
        .catch(function (error) {
          console.log(error, "error");
        });
    },
    //双击下钻地图
    changeMap(dbArea, name) {
      console.log(dbArea, "双击地图下钻");
      debugger;
      let that = this;
      that.overview(0);
      that.titleMap.name = name;
      that.titleMap.level++;
      if (that.titleMap.level > 3) that.titleMap.level = 3;
      //  this.timer = setInterval(this.getTime, 1000);
      if (that.titleMap.level == 2) {
        that.titleMap.oldName = name;
        that.titleMap.uuid = dbArea.cityOrgUuid;
      }
      console.log(that.titleMap, "下钻地区");
      if (that.clickArea.length < 3) that.clickArea.push(that.titleMap.name);
      if (that.titleMap.level == 2) {
        that.titleMap.cityUuid = dbArea.cityOrgUuid;
        that.initData("city_org_uuid", dbArea.cityOrgUuid, name);
      } else {
        that.titleMap.countyUuid = dbArea.cityOrgUuid;
        that.initData("county_org_uuid", dbArea.cityOrgUuid, name);
      }
    },
    //默认本市
    mapCrackDown(id) {
      let that = this;
      let imgUrl = require("../../assets/qjzl/dialogbg.png");
      // let min=that.mapData.sort((a, b) => a.value - b.value)[0].value;
      // let max = that.mapData.sort((a, b) => a.value - b.value)[that.mapData.length-1].value;
      // console.log(min,"min");
      // console.log(max,"max");
      let options = {
        tooltip: {
          show: true,
          backgroundColor: "rgba(0,0,0,0)",
          borderWidth: "0",
          formatter: function (params) {
            var res = "";
            if (params.seriesType != "scatter")
              res = `<div style="min-width:280px;background:url(${imgUrl}) no-repeat;background-size:100% 100%;padding:20px 30px;">
                  <div style="width:100%;margin:0 auto;padding:0 auto;text-align:center;font-size:16px;font-weight:bold;color:#fff;">
                    ${
                      typeof params.data == "undefined"
                        ? params.name
                        : params.data.cityName
                    }
                  </div>
                    ${that.formatterCustom(params.data)}
                </div>`;

            return res;
          },
        },
        //地图背景颜色
        // visualMap: {
        //   left: 'right',
        //   min: min,
        //   max: max,
        //   show: false,
        //   inRange: {
        //     color: [
        //     '#313695',
        //   '#4575b4',
        //   '#74add1',
        //   '#fdae61',
        //   '#f46d43',
        //   '#d73027',
        //   '#a50026'
        //     ]
        //   },
        //   text: ['High', 'Low'],
        //   calculable: true
        // },
        // 地图的阴影底图
        geo: {
          map: "anhui",
          zoom: 1.2,
          top: "15px",
          roam: false,
          layoutCenter: ["50%", "50%"], //位置
          layoutSize: "80%", //大小
          itemStyle: {
            normal: {
              areaColor: {
                type: "radial",
                x: 0.5,
                y: 0.5,
                r: 0.8,
                colorStops: [
                  {
                    offset: 0,
                    color: "#09132c", // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: "#274d68", // 100% 处的颜色
                  },
                ],
                globalCoord: true, // 缺省为 false
              },
              borderWidth: 6, //设置外层边框
              borderColor: "rgba(66, 199, 222,1)",
              shadowColor: "rgb(59, 11, 62)",
              shadowOffsetX: 10,
              shadowOffsetY: 11,
            },
          },
        },
        series: [
          {
            type: "map",
            map: "anhui",
            top: "50px",
            // aspectScale: 0.9,
            // layoutCenter: ["50%", "50%"], //地图位置
            // layoutSize: "100%",
            layoutCenter: ["50%", "50%"], //位置
            layoutSize: "80%", //大小
            zoom: 1.2,
            label: {
              normal: {
                show: true,
                fontFamily: "SourceHanSansCN",
                fontSize: "12",
                color: "#FEFEFE",
              },
              emphasis: {
                show: true,
                fontFamily: "SourceHanSansCN",
                fontSize: "12",
                color: "#FEFEFE",
              },
            },
            itemStyle: {
              areaColor: "rgba(5, 107, 158, 1)",
              color: "#2B5890", //地图颜色
              // borderWidth: 2, //分界线wdith
              // borderColor: "#000", //分界线颜色
              borderColor: "rgba(9, 13, 63,1)",
              borderWidth: 1,
              emphasis: {
                show: true,
                areaColor: "#ff7200", //鼠标滑过区域颜色
                label: {
                  show: true,
                  textStyle: {
                    color: "#fff",
                  },
                },
              },
            },
            // zlevel: 1,
            data: that.mapData,
          },
        ],
      };

      if (that.titleMap.level == 3) {
        axios
          .get(
            "/largescreen/sql/result/get_dept_by_country_uuid_ah_v1/?startDate=2023-01-01&endDate=2023-09-30&lastStartDate=2022-01-01&lastEndDate=2022-09-20&limit=10&orgUuid=" +
              that.titleMap.countyUuid
          )
          .then(function (res) {
            console.log(res);

            that.placeList = [];
            res.data.deptList.data.forEach((item) => {
              that.placeList.push({
                name: item.org_name,
                value: [item.longitude, item.latitude ],
                isActive: false,
                uuid: item.org_uuid,
              });
            });
            options.series.push({
              type: "scatter",
              coordinateSystem: "geo",
              data: that.placeList,
              symbol: function (value, params) {
                // console.log(params.data)
                if (params.data.isActive) {
                  return (
                    "image://" + require("../../assets/common-new/red-top.png")
                  );
                } else {
                  return "image://" + require("../../assets/common-new/ds.png");
                }
              },
              symbolSize: 20, // 图标大小
              label: {
                // emphasis: {
                show: true,
                position: "bottom",
                formatter: "{b}",
                // }
              },
              // itemStyle: {
              // normal: {
              // color: 'yellow' // 图标颜色
              //   }
              // }
            });
            that.$nextTick(() => {
              let myChart = that.$echarts.init(document.getElementById(id));
              if(myChart.getOption()){
                myChart.dispose();
                myChart = that.$echarts.init(document.getElementById(id));
              }
              that.regionsdata = [];
              that.$echarts.registerMap("anhui", that.dataMap);
              myChart.clear();
              console.log(that.mapData, "地图下钻数据");
              myChart.setOption(options);
              myChart.resize();
              myChart.off("dblclick");
              myChart.on("dblclick", (data) => {
                if (data.componentSubType === "scatter") {
                  console.log(55555,data, "scatter");
                  if (that.titleMap.level == 3 && that.clickArea.length == 4)
                    that.clickArea.pop();
                  that.clickArea.push(data.name);
                  that.initData("org_uuid", data.data.uuid, that.titleMap.name);

                  myChart.setOption(options);
                } else {
                  this.changeMap(data.data, data.name);
                }
              });
            });
          })
          .catch(function (error) {
            console.log(error);
          });
      } else {
        that.$nextTick(() => {
          let myChart = that.$echarts.init(document.getElementById(id));
          if(myChart.getOption()){
            myChart.dispose();
            myChart = that.$echarts.init(document.getElementById(id));
          }
          that.regionsdata = [];
          that.$echarts.registerMap("anhui", that.dataMap);
          myChart.clear();
          console.log(that.mapData, "地图下钻数据");
          myChart.setOption(options);
          myChart.resize();
          myChart.off("dblclick");
          myChart.on("dblclick", (data) => {
            if (data.componentSubType === "scatter") {
              this.placeList.forEach((k) => {
                if (k.name === data.data.name) {
                  k.isActive = true;
                } else {
                  k.isActive = false;
                }
              });

              myChart.setOption(options);
            } else {
              this.changeMap(data.data, data.name);
            }
          });
          myChart.on("mousemove", (param) => {
            if (!param.data) return;
            // that.mapbar("mapbar", param.data);
          });
          tools.loopShowTooltip(
            myChart,
            options,
            {
              loopSeries: true,
            },
            this
          );
        });
      }
    },
    //案件对标echarts
    barInit(id) {
      var that = this;

      this.$nextTick(() => {
        let myChart = that.$echarts.init(document.getElementById(id));
        // let DataName = [];
        // let xData = ["2023年上半年"];
        // let yTitle = {
        //   "jsy-box": "人均查获量（万支/人）",
        //   "yj-box": "烟机查获量(台)",
        //   "yyys-box": "烟丝烟叶查获量(吨)",
        // };
        // let data1 = [];
        // let data2 = [];
        // let data3 = [];
        // let data4 = [];
        // let data5 = [];
        // let data6 = [];
        // let maxVal = 10;
        // let minVal = 0;
        let XData = [];
        let YData = [];
        let barWidth = "18";
        let yAxisName = "人均查获量(万支/人)";
        if (id === "jsy-box") {
          if (that.titleMap.level === 1) {
            that.caseBmk.fakePerQty.data.forEach((item) => {
              XData.push(item?.org_name);
              YData.push(item?.fake_per_qty);
            });
          } else if (that.titleMap.level === 2) {
            that.caseBmk.avgPersonFakeNumCity.data.forEach((item) => {
              XData.push(item?.city_org_name);
              YData.push(item?.num);
            });
          } else if (that.titleMap.level === 3) {
            that.caseBmk.avgPersonFakeNumCounty.data.forEach((item) => {
              // XData.push(
              //   item?.COUNTY_ORG_NAME.replace("烟草专卖局", "")
              //     .replace("合肥市", "")
              //     .replace("淮南市", "")
              //     .replace("亳州市", "")
              //     .replace("黄山市", "")
              //     .replace("芜湖市", "")
              //     .replace("安徽省", "")
              //     .replace("分局", "区")
              // );
              XData.push(
                getShortName(item.COUNTY_ORG_NAME)
              );
              YData.push(item?.num);
            });
          }

          yAxisName = "人均查获量(万支/人)";
          // data1 = [that.caseBmk.fakePerQty.data[0]?.fake_per_qty];
          // data2 = [that.caseBmk.fakePerQty.data[1]?.fake_per_qty];
          // data3 = [that.caseBmk.fakePerQty.data[2]?.fake_per_qty];
          // data4 = [that.caseBmk.fakePerQty.data[3]?.fake_per_qty];
          // data5 = [that.caseBmk.fakePerQty.data[4]?.fake_per_qty];
          // data6 = [that.caseBmk.fakePerQty.data[5]?.fake_per_qty];
          // maxVal = that.caseBmk.fakePerQty.data.sort(
          //   (a, b) => a.fake_per_qty - b.fake_per_qty
          // )[0].fake_per_qty;
          // minVal = that.caseBmk.fakePerQty.data.sort(
          //   (a, b) => a.fake_per_qty - b.fake_per_qty
          // )[that.caseBmk.fakePerQty.data.length - 1].fake_per_qty;
        } else if (id === "yj-box") {
          if (that.titleMap.level === 1) {
            that.caseBmk.machQty.data.forEach((item) => {
              XData.push(item?.org_name);
              YData.push(item?.mach_qty);
            });
          }else if (that.titleMap.level === 2) {
            that.caseBmk1.smokeMachineCityData.data.forEach((item) => {
              XData.push(item?.city_org_name);
              YData.push(item?.qty);
            });
          }else if (that.titleMap.level === 3) {
            that.caseBmk1.smokeMachineCountyData.data.forEach((item) => {
           /*    XData.push(
                item?.county_org_name
                  .replace("烟草专卖局", "")
                  .replace("合肥市", "")
                  .replace("淮南市", "")
                  .replace("亳州市", "")
                  .replace("黄山市", "")
                  .replace("芜湖市", "")
                  .replace("安徽省", "")
                  .replace("分局", "区")
              ); */
              XData.push(item?.org_name_short)
              YData.push(item?.qty);
            });
          }
          yAxisName = "烟机查获量(台)";
          // data1 = [that.caseBmk.machQty.data[0]?.mach_qty];
          // data2 = [that.caseBmk.machQty.data[1]?.mach_qty];
          // data3 = [that.caseBmk.machQty.data[2]?.mach_qty];
          // data4 = [that.caseBmk.machQty.data[3]?.mach_qty];
          // data5 = [that.caseBmk.machQty.data[4]?.mach_qty];
          // data6 = [that.caseBmk.machQty.data[5]?.mach_qty];
          // maxVal = that.caseBmk.machQty.data.sort(
          //   (a, b) => a.mach_qty - b.mach_qty
          // )[0].mach_qty;
          // minVal = that.caseBmk.machQty.data.sort(
          //   (a, b) => a.mach_qty - b.mach_qty
          // )[that.caseBmk.machQty.data.length - 1].mach_qty;
        } else if (id === "yyys-box") {
          if (that.titleMap.level === 1) {
            that.caseBmk.leafCutQty.data.forEach((item) => {
              XData.push(item?.org_name);
              YData.push(item?.leaf_cut_qty);
            });
          } else if (that.titleMap.level === 2) {
            that.caseBmk1.tobaccoLeafCityData.data.forEach((item) => {
              XData.push(item?.city_org_name);
              YData.push(item?.qty);
            });
          } else if (that.titleMap.level === 3) {
            that.caseBmk1.tobaccoLeafCountyData.data.forEach((item) => {
              // XData.push(
              //   item?.county_org_name
              //     .replace("烟草专卖局", "")
              //     .replace("合肥市", "")
              //     .replace("淮南市", "")
              //     .replace("亳州市", "")
              //     .replace("黄山市", "")
              //     .replace("芜湖市", "")
              //     .replace("安徽省", "")
              //     .replace("分局", "区")
              // );
              XData.push(item?.org_name_short)
              YData.push(item?.qty);
            });
          }

          yAxisName = "烟叶烟丝查获量(吨)";
        }
        barWidth = (200 / XData.length).toFixed(0);
        let option = {
          tooltip: {
            show: true,
            trigger: "axis",
          },
          // tooltip: {
          //   show: false,
          //   trigger: "axis",
          //   axisPointer: {
          //     type: "cross",
          //     crossStyle: {
          //       color: "#666",
          //     },
          //   },
          // },
          grid: {
            left: "10%",
            right: "0",
            top: "20%",
            bottom: "10%",
            containLabel: true,
          },
          xAxis: [
            {
              type: "category",
              data: XData,
              axisPointer: {
                type: "shadow",
              },
              // boundaryGap: false, //让x轴坐标从紧挨着y轴开始
              axisLabel: {
                formatter: function (value) {
                  return value.split("").join("\n");
                },
              },
              // 坐标轴线
              axisLine: {
                show: false,
                lineStyle: {
                  color: "rgba(255,255,255,0.7)", //X轴字体颜色
                  fontSize: "12",
                },
              },
              axisTick: {
                show: false, //去掉图表横纵坐标轴刻度线
              },
            },
          ],
          yAxis: [
            {
              type: "value",
              name: yAxisName,
              nameTextStyle: {
                color: "rgba(255, 255, 255, 0.5)",
                fontSize: 12,
              },

              // min: 0,
              // max: 40,
              // interval: 50,
              axisLabel: {
                formatter: "{value}",
                textStyle: {
                  color: "rgba(255,255,255,0.7)", //Y轴内容文字颜色
                },
              },
              axisLine: {
                show: true,
                lineStyle: {
                  color: "rgba(66, 164, 255, 0.3)", //y轴
                  type: "solid",
                  // fontSize: '12',
                },
              },
              splitLine: {
                show: true,
                lineStyle: {
                  type: "solid",
                  color: "rgba(66, 164, 255, 0.3)", //里面横着的虚线
                },
              },
            },
          ],
          series: [
            {
              // name: DataName[0],
              type: "bar",
              data: YData,
              barWidth: barWidth,

              // seriesLayoutBy: 'row',
              itemStyle: {
                normal: {
                  // barBorderRadius: [30, 30, 0, 0],
                  label: {
                    show: true, //开启显示
                    position: "top", //在上方显示
                    textStyle: {
                      //数值样式
                      color: "#fff",
                      fontSize: that.titleMap.level==1?14:10,
                    },
                  },
                  color: {
                    x: 0,
                    y: 0,
                    x2: 1,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "rgba(61, 185, 210, 1)",
                      }, //第一顶部颜色
                      {
                        offset: 1,
                        color: "rgba(42, 126, 159, 0.8)",
                      }, //第一底部颜色
                    ],
                  },
                },
              },
            },
          ],
        };
        // let option = {
        //   tooltip: {
        //     show: true,
        //     trigger: "axis",
        //     // axisPointer: {
        //     //   type: "cross",
        //     //   crossStyle: {
        //     //     color: "#666",
        //     //   },
        //     // },
        //   },
        //   legend: {
        //     data: DataName,
        //     icon: "circle",
        //     right: 10,
        //     top: 30,
        //     textStyle: {
        //       fontSize: "12",
        //       color: "rgba(255,255,255,0.7)",
        //     },
        //   },
        //   grid: {
        //     left: "10%",
        //     right: "0%",
        //     bottom: "10%",
        //     top: "32%",
        //     containLabel: true,
        //   },
        //   xAxis: [
        //     {
        //       type: "category",
        //       data: xData,
        //       axisPointer: {
        //         type: "shadow",
        //       },
        //       // boundaryGap: false, //让x轴坐标从紧挨着y轴开始
        //       // 坐标轴线
        //       axisLine: {
        //         show: false,
        //         lineStyle: {
        //           color: "rgba(255,255,255,0.7)", //X轴字体颜色
        //           fontSize: "12",
        //         },
        //       },
        //       axisTick: {
        //         show: false, //去掉图表横纵坐标轴刻度线
        //       },
        //     },
        //   ],
        //   yAxis: [
        //     {
        //       type: "value",
        //       name: yTitle[id],
        //       nameTextStyle: {
        //         color: "rgba(255, 255, 255, 0.5)",
        //         fontSize: 12,
        //       },

        //       min: minVal,
        //       max: maxVal,
        //       // interval: 50,
        //       axisLabel: {
        //         formatter: "{value}",
        //         textStyle: {
        //           color: "rgba(255,255,255,0.7)", //Y轴内容文字颜色
        //         },
        //       },
        //       axisLine: {
        //         show: true,
        //         lineStyle: {
        //           color: "rgba(66, 164, 255, 0.3)", //y轴
        //           type: "solid",
        //           // fontSize: '12',
        //         },
        //       },
        //       splitLine: {
        //         show: true,
        //         lineStyle: {
        //           type: "solid",
        //           color: "rgba(66, 164, 255, 0.3)", //里面横着的虚线
        //         },
        //       },
        //     },
        //   ],
        //   series: [
        //     {
        //       name: DataName[0],
        //       type: "bar",
        //       data: data1,
        //       barWidth: "40",
        //       // seriesLayoutBy: 'row',
        //       itemStyle: {
        //         // barBorderRadius: [30, 30, 0, 0],
        //         color: {
        //           x: 0,
        //           y: 0,
        //           x2: 1,
        //           y2: 1,
        //           colorStops: [
        //             {
        //               offset: 0,
        //               color: "rgba(196, 67, 93, 1)",
        //             }, //第一顶部颜色
        //             {
        //               offset: 1,
        //               color: "rgba(127, 60, 97, 1)",
        //             }, //第一底部颜色
        //           ],
        //         },
        //       },
        //     },
        //     {
        //       name: DataName[1],
        //       type: "bar",
        //       data: data2,
        //       barWidth: "40",
        //       //seriesLayoutBy: 'row',
        //       itemStyle: {
        //         // barBorderRadius: [20, 20, 0, 0],
        //         color: {
        //           x: 0,
        //           y: 0,
        //           x2: 1,
        //           y2: 1,
        //           colorStops: [
        //             {
        //               offset: 0,
        //               color: "rgba(2, 82, 216, 1)",
        //             }, //第二顶部颜色
        //             {
        //               offset: 1,
        //               color: "rgba(32, 90, 133, 1)",
        //             }, //第二底部颜色
        //           ],
        //         },
        //       },
        //     },
        //     {
        //       name: DataName[2],
        //       type: "bar",
        //       data: data3,
        //       barWidth: "40",
        //       //seriesLayoutBy: 'row',
        //       itemStyle: {
        //         // barBorderRadius: [20, 20, 0, 0],
        //         color: {
        //           x: 0,
        //           y: 0,
        //           x2: 1,
        //           y2: 1,
        //           colorStops: [
        //             {
        //               offset: 0,
        //               color: "rgba(4, 189, 114, 1)",
        //             }, //第三顶部颜色
        //             {
        //               offset: 1,
        //               color: "rgba(6, 141, 111, 1)",
        //             }, //第三底部颜色
        //           ],
        //         },
        //       },
        //     },
        //     {
        //       name: DataName[3],
        //       type: "bar",
        //       data: data4,
        //       barWidth: "40",
        //       //seriesLayoutBy: 'row',
        //       itemStyle: {
        //         // barBorderRadius: [20, 20, 0, 0],
        //         color: {
        //           x: 0,
        //           y: 0,
        //           x2: 1,
        //           y2: 1,
        //           colorStops: [
        //             {
        //               offset: 0,
        //               color: "rgba(189, 168, 53, 1)",
        //             }, //第四顶部颜色
        //             {
        //               offset: 1,
        //               color: "rgba(137, 131, 65, 1)",
        //             }, //第四底部颜色
        //           ],
        //         },
        //       },
        //     },
        //     {
        //       name: DataName[4],
        //       type: "bar",
        //       data: data5,
        //       barWidth: "40",
        //       //seriesLayoutBy: 'row',
        //       itemStyle: {
        //         // barBorderRadius: [20, 20, 0, 0],
        //         color: {
        //           x: 0,
        //           y: 0,
        //           x2: 1,
        //           y2: 1,
        //           colorStops: [
        //             {
        //               offset: 0,
        //               color: "rgba(59, 179, 205, 1)",
        //             }, //第五顶部颜色
        //             {
        //               offset: 1,
        //               color: "rgba(57, 135, 170, 1)",
        //             }, //第五底部颜色
        //           ],
        //         },
        //       },
        //     },
        //     {
        //       name: DataName[5],
        //       type: "bar",
        //       data: data6,
        //       barWidth: "40",
        //       //seriesLayoutBy: 'row',
        //       itemStyle: {
        //         // barBorderRadius: [20, 20, 0, 0],
        //         color: {
        //           x: 0,
        //           y: 0,
        //           x2: 1,
        //           y2: 1,
        //           colorStops: [
        //             {
        //               offset: 0,
        //               color: "rgba(152, 0, 241,0.7)",
        //             }, //第六顶部颜色
        //             {
        //               offset: 1,
        //               color: "rgba(152, 0, 241,1)",
        //             }, //第六底部颜色
        //           ],
        //         },
        //       },
        //     },
        //   ],
        // };
        myChart.showLoading();
        // 初始化地图
        myChart.setOption(option, false);
        myChart.resize();
        myChart.hideLoading();
      });
    },
    toggleBtn(i) {
      // 案件对标数据按钮
      this.activeAjdbIndex = i;
      this.$nextTick(() => {
        if (!i) {
          this.barInit("jsy-box");
        } else if (i === 1) {
          this.barInit("yj-box");
        } else if (i === 2) {
          this.barInit("yyys-box");
        }
      });
    },
    // 案值总览切换按钮
    /*   toggleBtn2(i) {
      this.activeAzzlIndex = i;
      console.log(this.caseValNums, "案值总览");
      let DataDMTemp = [];
      let DataATemp = [];
      // 案值总览
      if (!this.activeAzzlIndex) {
        //卷烟案值

        this.caseValNums.cigarValTrend.data.forEach((k) =>
          DataDMTemp.push(k.year)
        );
        this.caseValNums.cigarValTrend.data.forEach((k) =>
          DataATemp.push(k.num)
        );
      } else {
        // 电子烟案值
        this.caseValNums.ecigarValTrend.data.forEach((k) =>
          DataDMTemp.push(k.year)
        );
        this.caseValNums.ecigarValTrend.data.forEach((k) =>
          DataATemp.push(k.num)
        );
      }
      this.DataDM = DataDMTemp;
      this.DataA = DataATemp;
    }, */
    bgqihuan2(index) {
      this.currentIndex2 = index;
      this.showPic = index;
    },
    async overview(type) {
      console.log("qiehuansadasdasdasds");
      this.showType = type;
      if (type === 0) {
        this.$nextTick(() => {
          //案件总览
          this.initpie();
          this.initFromPie();
        });
      } else if (type === 1) {
        console.log(1);
        /*  this.activeAzzlIndex = 0;
        let DataDMTemp = [];
        let DataATemp = [];
        // 案值总览
        if (!this.activeAzzlIndex) {
          //卷烟案值
          this.caseValNums.cigarValTrend.data.forEach((k) =>
            DataDMTemp.push(k.year)
          );
          this.caseValNums.cigarValTrend.data.forEach((k) =>
            DataATemp.push(k.num)
          );
        }
        this.DataDM = DataDMTemp;
        this.DataA = DataATemp; */

        this.$forceUpdate();
      } else if (type === 2) {
        this.$forceUpdate();
      }
    },
    getNowDate() {
      const timeOne = new Date();
      const year = timeOne.getFullYear();
      let month = timeOne.getMonth() + 1;
      let day = timeOne.getDate();
      day = day < 10 ? "0" + day : day;
      const time = `${month}月${day}日`;
      return time;
    },
    //zyflowulrightbar
    divcolorswitch(data) {
      // 二级
      if (data.rank == "一级") {
        return "redcolor";
      } else if (data.rank == "二级") {
        return "yellowcolor";
      } else if (data.rank == "三级") {
        return "bluecolor";
      } else if (data.rank == "四级") {
        return "greencolor";
      }
      //       // 红色一级，黄色二级，蓝色三级，绿色四级
    },
    changeHideShow(type) {
      // if(type){
      //   this.$refs.crackDownMap.closeLoopTip();
      // }else{
      //   this.$refs.crackDownMap.loopTip();
      // }
      this.isHideShow = type;
    },
    //鼠标滑过效果
    bgqihuan(index) {
      this.currentIndex = index;
      if (index == 0) {
        this.showWhat = "echartsbar";
      } else if (index == 1) {
        this.showWhat = "tousu";
      } else {
        this.showWhat = "xuke";
      }
    },
    formatterCustom(data) {
      return `<div class="content">

<div class="info">

<span class="infoText">案件数量：</span>

<span class="infoNum">${data?.value || 0}</span>

<span class="infoUnit">起</span>

</div>
        <div class="info">

<span class="infoText">5万元以上案件：</span>

<span class="infoNum">${data?.value1 || 0}</span>

<span class="infoUnit">起</span>

</div>
        <div class="info">

<span class="infoText">查获卷烟：</span>

<span class="infoNum">${data?.value2 || 0}</span>

<span class="infoUnit">万支</span>

</div>
        <div class="info">

<span class="infoText">涉案案值：</span>

<span class="infoNum">${data?.value3 || 0}</span>

<span class="infoUnit">万元</span>

</div>

</div>`;
    },
    //饼图
    initpie() {
      let mychart = this.$echarts.init(document.getElementById("echartsPie"));
      let chartData = this.caseTotalPieData;
      let option = {
        // color: ["#7FFDFF", "#FFDC95", "#8C36FF", "#61EBAC", "#FF7C5A"],
        color: [
          "#cb455e",
          "#0158e9",
          "#d3b931",
          "#04c375",
          "#C36004",
          "#4951FF",
          "#42C7DE",
          "#168D6F",
          "#15ABFF",
        ],
        title: [
          {
            show: true,
            text: chartData.reduce((pre, cur) => pre + cur.value, 0),
            subtext: "(起)",
            textStyle: {
              fontSize: 18,
              color: "rgba(52, 239, 254, 1)",
              fontWeight: "normal",
            },
            subtextStyle: {
              fontSize: 14,
              color: "#fff",
              // fontWeight: "bold",
            },
            textAlign: "center",
            x: "24%",
            y: "35%",
          },
        ],
        legend: {
          orient: "vertical",
          top: "0%",
          right: "0%",
          itemWidth: 15,
          itemHeight: 10,
          data: chartData
            ? chartData.map((it) => {
                console.log(it);
                return it.name;
              })
            : [],
          textStyle: {
            fontSize: 14,
            color: "#fff",
            rich: {
              one: {
                color: "#34EFFE",
                fontWeight: 600,
              },
            },
          },
          formatter: (name) => {
            let num = 0;
            for (var i = 0; i < chartData.length; i++) {
              if (name == chartData[i].name) {
                num = chartData[i].value;
              }
            }
            return `${name} {one|${num}}`;
          },
        },
        tooltip: {
          trigger: "item",
          formatter: function (params) {
            let str = `${params.data.name}: ${params.percent}%`;
            return str;
          },
        },
        series: [
          {
            name: "渠道去向",
            type: "pie",
            radius: ["50%", "80%"],
            center: ["25%", "50%"],
            // roseType: "radius",
            clockwise: false,
            label: {
              normal: {
                show: false,
                position: "outside",
                fontSize: 14,
              },
            },
            labelLine: {
              show: false,
              smooth: true,
            },
            radius: ["70%", "95%"],
            data: chartData || [],
          },
        ],
      };
      mychart.setOption(option);
      mychart.off("legendselectchanged");
      mychart.on("legendselectchanged", function (obj) {
        // console.log(obj);
        let selectArr = [];
        for (const key in obj.selected) {
          if (obj.selected[key]) {
            selectArr.push(key);
          }
        }
        // console.log(selectArr,'=============');
        let result = 0;
        selectArr.forEach((k) => {
          chartData.forEach((cur) => {
            if (k === cur.name) {
              result += cur.value;
            }
          });
        });
        option.title[0].text = result;
        mychart.setOption(option);
        console.log(option);
        // console.log(this.NightingaleaTot,'=========222======');
      });
      mychart.getZr().on("mouseover", (event) => {
        const legendDataIndex = event.topTarget.parent.__legendDataIndex; // 每个legend的index
        // console.log(legendDataIndex,'=====================');
        this.$emit("retailerIntro", legendDataIndex);
      });
      mychart.getZr().on("mouseout", (event) => {
        this.$emit("retailerIntroHide");
      });
    },
    // 案件总览-案件来源饼图
    initFromPie() {
      let mychart = this.$echarts.init(
        document.getElementById("echartsPieFrom")
      );
      let chartData = this.caseTotalFromPieData;

      let option = {
        // color: ["#7FFDFF", "#FFDC95", "#8C36FF", "#61EBAC", "#FF7C5A"],
        color: [
          "#cb455e",
          "#0158e9",
          "#d3b931",
          "#04c375",
          "#C36004",
          "#4951FF",
          "#42C7DE",
          "#168D6F",
          "#15ABFF",
        ],
        title: [
          {
            show: true,
            text: chartData.reduce((pre, cur) => pre + cur.value, 0),
            subtext: "(起)",
            textStyle: {
              fontSize: 18,
              color: "rgba(52, 239, 254, 1)",
              fontWeight: "normal",
            },
            subtextStyle: {
              fontSize: 14,
              color: "#fff",
              // fontWeight: "bold",
            },
            textAlign: "center",
            x: "24%",
            y: "35%",
          },
        ],
        legend: {
          orient: "vertical",
          top: "0%",
          right: "16%",
          itemWidth: 15,
          itemHeight: 10,
          data: chartData
            ? chartData.map((it) => {
                return it.name;
              })
            : [],
          textStyle: {
            fontSize: 14,
            color: "#fff",
            rich: {
              one: {
                color: "#34EFFE",
                fontWeight: 600,
              },
            },
          },
          formatter: (name) => {
            let num = 0;
            for (var i = 0; i < chartData.length; i++) {
              if (name == chartData[i].name) {
                num = chartData[i].value;
              }
            }
            return `${name} {one|${num}}`;
          },
        },
        tooltip: {
          trigger: "item",
          formatter: function (params) {
            let str = `${params.data.name}: ${params.percent}%`;
            return str;
          },
        },
        series: [
          {
            name: "渠道去向",
            type: "pie",
            radius: ["50%", "80%"],
            center: ["25%", "50%"],
            // roseType: "radius",
            clockwise: false,
            label: {
              normal: {
                show: false,
                position: "outside",
                fontSize: 14,
              },
            },
            labelLine: {
              show: false,
              smooth: true,
            },
            radius: ["70%", "95%"],
            data: chartData || [],
          },
        ],
      };
      mychart.setOption(option);
      mychart.off("legendselectchanged");
      mychart.on("legendselectchanged", function (obj) {
        // console.log(obj);
        let selectArr = [];
        for (const key in obj.selected) {
          if (obj.selected[key]) {
            selectArr.push(key);
          }
        }
        // console.log(selectArr,'=============');
        let result = 0;
        selectArr.forEach((k) => {
          chartData.forEach((cur) => {
            if (k === cur.name) {
              result += cur.value;
            }
          });
        });
        option.title[0].text = result;
        mychart.setOption(option);
        console.log(option);
        // console.log(this.NightingaleaTot,'=========222======');
      });
      mychart.getZr().on("mouseover", (event) => {
        const legendDataIndex = event.topTarget.parent.__legendDataIndex; // 每个legend的index
        // console.log(legendDataIndex,'=====================');
        this.$emit("retailerIntro", legendDataIndex);
      });
      mychart.getZr().on("mouseout", (event) => {
        this.$emit("retailerIntroHide");
      });
    },
    getTime() {
      const date = new Date();
      const year = date.getFullYear();
      const month = date.getMonth() + 1;
      const day = date.getDate();
      const hour = date.getHours();
      const minute = date.getMinutes();
      const second = date.getSeconds();
      // const str = ''
      // if (this.hour > 12) {
      //     this.hour -= 12;
      //     this.str = " AM";
      // } else {
      //     this.str = " PM";
      // }
      this.month = check(month);
      this.day = check(day);
      this.hour = check(hour);
      this.minute = check(minute);
      this.second = check(second);

      function check(i) {
        const num = i < 10 ? "0" + i : i;
        return num;
      }
      //  this.nowDate = year + "年" + this.month + "月" + this.day + "日";
      this.nowTime =
        year +
        "年" +
        this.month +
        "月" +
        this.day +
        "日 " +
        this.hour +
        ":" +
        this.minute +
        ":" +
        this.second;
    },
  },
  beforeDestroy() {
    if (this.timer) {
      clearInterval(this.timer); // 在Vue实例销毁前，清除定时器
    }
  },
};
</script>

<style lang="scss" scoped>
@import "../../assets/scss/qjzl.scss";

.wpzl-content {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
  .content-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5px;
    margin-bottom: 14px;
    width: 210px;
    height: 90px;
    background: url(../../assets/qjzl-new/scjg/bg2.png);
    background-size: 100% 100%;

    &:nth-of-type(1) {
      margin-right: 10px;
    }
    &:nth-of-type(3) {
      margin-right: 10px;
    }
    .num {
      display: flex;
      margin-top: 10px;
      .text {
        margin-right: 10px;
      }
    }
  }
}
.zjzl-box {
  margin-top: 8px;
}
.azzl-box {
  .list-one {
    display: flex;
    justify-content: space-between;
    padding: 10px;
  }
  .list-one-item {
    width: 170px;
    text-align: center;
    .title2 {
      line-height: 57px;
      height: 42px;
      background: url(../../assets/xzxk-new/zhgl/num-bg.png);
      background-size: 100% 100%;
    }
  }
}
.zyyl-box {
  margin-top: 8px;
  .content {
    margin-top: 10px;
    padding: 19px 19px 0px 19px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    // height: 288px;
    background: url(../../assets/qjzl-new/scjg/bg1.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    .content-item {
      padding: 5px 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      margin-bottom: 8px;
      width: 220px;
      height: 74px;
      background: url(../../assets/qjzl-new/scjg/bg2.png);
      background-size: 100% 100%;
      .num {
        display: flex;
        margin-top: 5px;
        .text {
          margin-right: 10px;
        }
      }
    }
    .content-item1 {
      padding: 5px 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      margin-bottom: 8px;
      width: 220px;
      height: 74px;
      background: url(../../assets/qjzl-new/scjg/bg3.png);
      background-size: 100% 100%;
      .num {
        display: flex;
        margin-top: 5px;
        .text {
          margin-right: 10px;
        }
      }
    }
  }
}
.ajdb-box {
  margin-top: 10px;
  height: 260px;

  background: url(../../assets/djds-new/ajdb/bg.png);
  background-size: 100% 100%;
}
.ajzl-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  // margin-bottom: 20px;
  .ajzl-center-item {
    margin-bottom: 20px;
    width: 210px;
    height: 50px;
    background-size: 100% 100% !important;
    line-height: 50px;

    ::v-deep .el-popover__reference {
      display: flex;
      justify-content: center;
    }
  }
}

.leftImage {
  img {
    width: 100%;
  }
}

.rightbox2 {
  display: flex;
  justify-content: space-between;
  .mode-title {
    width: 33%;
    background-size: 100% 100% !important;
    cursor: pointer;
    margin-bottom: 10px;
  }
}

.mask-postion {
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(16, 11, 42, 0.7);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.anhuiMap ::v-deep .content {
  width: 100%;

  .info {
    height: 36px;
    line-height: 36px;
    padding: 0 10px;
    background: rgba(41, 138, 255, 0.15);
    display: flex;
    align-items: center;

    .infoText {
      max-width: 150px;
    }

    .infoText,
    .infoUnit {
      font-size: 11px;
      font-weight: bold;
      color: #ffffff;
    }

    .infoUnit {
      width: 30px;
    }

    .infoNum {
      flex: 1;
      text-align: right;
      display: inline-block;
      font-size: 17px;
      font-weight: bold;
      color: #34effe;
      padding: 0 3px;
    }
  }
}

.crackDown {
  display: flex;

  .crackDownLeft {
    margin-top: -55px;
    width: 470px;

    .lftopdiv {
      // height:235px;
      .rollTable {
        margin: 0 auto;
        height: 207px;
        width: 95%;
        font-size: 14px;
        padding: 8px 14px 19px 14px;
      }
    }

    .yjssxxdiv {
      height: 150px;
      overflow: hidden;
      overflow-y: hidden;
    }

    .lfbotdiv {
      background: url(../../assets/djds-new/zl/ajzl/bg.png);
      background-size: 100% 100%;
      .anzl-num-box {
        width: 100%;
        height: 40px;
        padding: 0 10px 0 55px;
        display: flex;
        line-height: 40px;
        justify-content: space-between;
        margin-bottom: 20px;
      }
      .botdivTop {
        display: flex;
        // margin-bottom: 30px;
      }
    }
  }

  .qjzlcenter {
    width: 885px;
    .centerBto {
      height: 243px;
      margin-top: 12px;
      background: url(../../assets/djds-new/zdaj/bg.png);
      background-size: 100% 100%;
    }

    // .centerBto::after {
    //   bottom: -5px;
    // }

    .overviewHeader {
      margin-top: 17px;
      display: flex;
      justify-content: center;

      .overviewHeaderL {
        margin-right: 20px;
      }
      .overviewHeaderL,
      .overviewHeaderR {
        display: flex;
        justify-content: space-between;
        padding: 0 36px 0 60px;
        width: 314px;
        height: 40px;
        line-height: 40px;

        background: url(../../assets/djds-new/zdaj/num-title.png);
        background-size: 100% 100%;
      }
    }

    .overviewContent {
      margin-top: 14px;
      padding: 0 40px;
    }

    .overviewbto {
      display: flex;
      justify-content: space-between;
      .dashboard {
        // flex: auto;
        display: flex;

        & > div {
          font-size: 14px;
          // flex: 1;
          width: 240px;
          text-align: center;
        }
      }

      .ks-list {
        display: flex;
        width: 150px;
        flex-wrap: wrap;
        // flex-shrink: 0;
        height: auto;
        // align-items: center;
        justify-content: space-around;
        margin: 10px 20px 0 0;
        .ks-list-item {
          margin-right: 8px;
          margin-bottom: 10px;
          width: 120px;
          height: 20px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          font-size: 14px;

          & > div {
            line-height: 1.4;
            color: #34effe;
          }
        }
      }
    }
  }

  .rhtopdiv {
    .rhtopdivBox {
      margin: 10px;

      .topMoney {
        width: 100%;
        height: 78px;
        background: url(../../assets/img/bg-s-money.png) no-repeat;
        background-size: 100% 100%;
        display: flex;
        align-items: center;
        justify-content: space-around;

        .moneyCenter {
          display: flex;
          margin-left: -20px;

          > div {
            padding-left: 15px;
          }
        }

        > div {
          p {
            font-size: 14px;
            font-weight: bold;
            color: #ffffff;
          }

          i {
            font-style: normal;
            display: inline-block;
            padding-top: 3px;
            color: rgba(45, 239, 255, 1);
            font-weight: bold;
            font-size: 25px;
          }
        }
      }

      .topContentNum {
        margin-top: 18px;
      }

      .topContent {
        display: flex;
      }
    }
  }

  .rhbtoDivBox::after {
    bottom: -2%;
  }

  .rhbtoDivBox {
    height: 467px;
    position: relative;
    cursor: pointer;

    .rankingQuery {
      width: 40px;
      position: absolute;
      left: 50%;
      margin-left: -16px;
      top: 23%;
      transform: scale(0.9, 0.9);
    }

    .btoTopBox {
      margin-top: 30px;
      width: 100%;
      height: 138px;
      background: url(../../assets/qjzl/bg-pm.png) no-repeat;
      background-size: 100% 100%;
      display: flex;
      justify-content: space-between;

      > div {
        width: 158px;

        p {
          font-size: 14px;
          font-weight: bold;
          color: #ffffff;

          span,
          i {
            font-size: 12px;
            font-weight: 400;
            color: #ffffff;
            color: rgba(255, 255, 255, 1);
          }

          i {
            font-style: normal;
            padding-left: 3px;
            color: rgba(52, 239, 254, 1);
            display: inline-block;
          }
        }

        p:nth-child(2) {
          // background: red;
          font-size: 16px;
          font-weight: bold;

          span {
            color: #34effe;
          }

          i {
            font-style: normal;
            padding-left: 3px;
            color: rgba(255, 255, 255, 1);
          }
        }
      }

      .btoTopBoxLeft {
        padding-left: 10px;
        transform: scale(0.9, 0.9);

        > div {
          padding-top: 5px;
        }

        > div:nth-child(2) {
          padding-top: 42px;
        }
      }

      .btoTopBoxRight {
        padding-right: 10px;
        transform: scale(0.9, 0.9);

        > div {
          padding-top: 5px;
        }

        > div:nth-child(2) {
          padding-top: 42px;
        }
      }
    }

    .btobtoBox {
      //   display: flex;
    }
  }
}

.topFoldLine {
  margin-top: 20px;
  position: relative;
}

.btnisnan {
  position: absolute;
  z-index: 500;
  margin: 20px;

  ul {
    .isactive {
      background: url(../../assets/img/hover.png);
      background-size: 100% 100%;
    }

    li {
      // width: 21%;
      // height: 30px;
      padding: 3px 10px;
      list-style: none;
      float: left;
      font-size: 12px;
      // margin-left: 4%;
      // line-height: 30px;
      background: url(../../assets/img/btnhover.png);
      background-size: 100% 100%;
      text-align: center;
      cursor: pointer;
    }

    li:hover {
      background: url(../../assets/img/hover.png);
      background-size: 100% 100%;
    }
  }
}

.boxgrond {
  width: 470px;
  height: 193px;
  background: url(../../assets/img/border.png);
  background-size: 100% 100%;
  margin-bottom: -40px;
  margin-left: -40px;
  position: relative;

  .hoverbox {
    width: 250px;
    height: 30px;
    background: url(../../assets/img/jindutiao.png);
    background-size: 100% 100%;
    margin-left: 15%;
    margin-top: 10%;
    position: absolute;
    left: 15px;
    top: 45px;
    color: #fff;

    ul {
      width: 100%;
      list-style: normal;

      li {
        float: left;
        font-size: 12px;
      }
    }
  }

  .titleti {
    width: 85%;
    height: 25px;
    line-height: 25px;
    padding-left: 10px;
    background: #083f81;
    margin-left: 7%;
    font-size: 14px;
    position: absolute;
    left: 0;
    top: 35px;
    color: #fff;
  }
}
.width200px {
  width: 200px;
}
.width100px {
  width: 100px;
}
.marginleft15px {
  margin-left: 15px;
}
.textoverflow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.width160px {
  width: 160px;
}

.safe-color {
  // color: #01fe01;
  color: #04C375 !important;
}
.danger-color {
  // color: #df0213;
  color: #CB455E !important;
}
</style>
